Click here to Skip to main content
15,895,011 members
Articles / Database Development / SQL Server

Efficient paging using SQL script

Rate me:
Please Sign up or sign in to vote.
4.57/5 (4 votes)
28 Dec 2011CPOL 8.3K   2  
Hi, what about such solution?DECLARE @pageNumber INTDECLARE @rowsOnPage INTSET @rowsOnPage=5SET @pageNumber=2DECLARE @totalItemsToSelect INTSET @totalItemsToSelect=@rowsOnPage * @pageNumberSELECT TOP (@rowsOnPage) * FROM MainTrans WHERE ID IN( SELECT TOP...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions