with data as ( select distinct skuId, sku + ' - ' + skuDesc as sku from tbl_DW_ProductHierarchy#_tableSuffix# with (nolock) where ownerId = and ownerType = and operatorPurchasing = 'Y' ) select count(*) over() as fseRowCount, skuId, sku from data where skuId in ( ) #applyFilter( _dataStore.filter )# and #applyFilter( _dataStore.search )# order by sku offset #_dataStore.skip# rows fetch next #_dataStore.take# rows only for JSON AUTO, INCLUDE_NULL_VALUES