SQL Server 2005 Paging Demo

I got thinking about writing custom paging code with the new SQL Server 2005 ROW_NUMBER, RANK, and DENSE_RANK functions.  I started playing around with code and ended up with this simple ASP.NET 2.0 example. It works with SQL Server 2005 and the Adventure Works sample database.  The example uses ad-hoc SQL so it would be easy to show how it works, but moving it into stored procs would be simple. 

I'd love any feedback!

PagingDemo.zip

 

Comments:

Gravatar

Nice! Thanks for posting the example.

Gravatar

Very creative code. I like it.

Gravatar

Thanks. It just baffles me why Microsoft still cannot see fit to implement the functionality of the LIMIT statement supported by some other SQL servers.


 



 
Save Cancel