Paging In SQL Server

1
10

ImagePaging can be done from Front End Pretty easy but more stable and Easy method is using SQL Server Storedprocedure Method , a sample script is below

Declare @pageNo int

Declare @@pageCount int

set @pageNo=1 — Page no of data which is required from the database

set @@pageCount=10

Select ROW_NUMBER() OVER ( ORDER BY field asc) AS [Row_Number],* from table where

where [ROW_NUMBER] between ((@pageNo-1)*@@pageCount +1) and (@pageNo*@@pageCount )

 Ref:techipost.com

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here