存储过程实现自定义分页
分页存储过程:
create procedure sp_GetCurentPage
(@pagesize int, --页面大小
@pageindex int) --当然页号
as
begin
with temptbl as (
SELECT ROW_NUMBER() OVER (ORDER BY address desc)AS Row, * from test )
SELECT * FROM temptbl where Row between (@pageindex-1)*@pagesize+1 and (@pageindex-1)*@pagesize+@pagesize
end