table 'sample' contaning fields [AffiliateId] as a primary key, [AffiliateCode] L, [Name] , [AddressId] [, [Url] , [EmailId] , [ShopId] ,
i need a stored procedure for custom paging
table 'sample' contaning fields [AffiliateId] as a primary key, [AffiliateCode] L, [Name] , [AddressId] [, [Url] , [EmailId] , [ShopId] ,
i need a stored procedure for custom paging
in sqlserver 2005 reference or example:
SELECT * FROM ( SELECT row_number() OVER (ORDER BY id) AS resultNum, id FROM table_name) AS numberResultsWHERE resultNum BETWEEN ? AND ?
for older versions see reference or reference2