SQL SERVER TUTORIAL IN DEPTH

The blog is to help users about sql server

Others

LightBlog

Breaking

Saturday 14 December 2013

Custom Paging SP

--How custom paging Sp works

alter proc finalproc --0,10
@pageindex int,
@pagesize int
as
begin

select id,name,age,sex
 from
(
 select row_number() over (order by id) as row,id,name,age,sex from finaltable1
 )temp
 where row >= (@pageindex + 1) and row <= ((@pageindex + 1)*@pagesize)
end

















No comments:

Post a Comment

 test