There is no out of the box way to do this with MSSQL but its a common request for web applications so you can show rows 1-10, 11-20, 21-30, etc. on a website. Try googling "MSSQL PAGING" or "MSSQL PAGINATION" and you should come up with a lot of relevant results. There are a number of ways to go about doing this and you will need to choose the one that fits your needs best.
Here is a sample:
With EmployeesCTE
as
(
SELECT row_number() over (ORDER BY Name) as rownum,*
FROM Employees
)
SELECT * FROM EmployeesCTE
WHERE rownum BETWEEN 291 AND 300
ORDER BY Name
I took that code from:
http://forloveofsoftware.blogspot.co...ends-here.html
Reputation Points: 1749
Solved Threads: 735
Senior Poster
Offline 3,948 posts
since Feb 2009