getting in bettwen records from all records return | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

getting in bettwen records from all records return

hello i m getting 8K records from my query i want to get records in x units i.e. 500 records at a time
first 500 rec. and then from 500 to 1000 and so on how can i do this using sql query
http://weblogs.sqlteam.com/jeffs/archive/2004/03/22/1085.aspx SqlSpec: a fast and comprehensive data dictionary generator for
SQL Server 2000/2005, Analysis Server 2005, Access 97/2000/XP/2003
www.elsasoft.org

In 2005, you can even take advantage of
row_number() OVER(ORDER BY columnname) consider this example: WITH DynamicPages AS
(SELECT row_number() OVER(ORDER BY column1) rownumber,column1,column2 FROM yourTable) SELECT column1,column2 FROM DynamicPages
WHERE rownumber BETWEEN 500 and 1000
]]>