INTERNET APPLICATION DEVELOPMENT
MID MARKET ERP DEVELOPMENT
by Jacky Xu
Before a new version of SQL server is released, we always implement data paging through the transact-SQL function “ROW_NUMBER” and it always needs a nested SQL script. Microsoft released new scripts “OFFSET” and “FETCH” for data paging functions. Here are two sample queries for different SQL server version paging function.
First, we query all data:
1. SQL server 2005 – 2008
2. SQL server 2012
If you also want to get a page row index, simply add a nested script to get it: