Sql server 使用存储过程分页显示

create proc GetPageList --定义存储过程
@papeIndex int=1, --定义第几页
@pageSie int=5 --定义每页显示的条数
as --sql 语句
select * from (select ROW_NUMBER() over(order by id) as num,* from student ) as temp where num between (@papeIndex-1)*@pageSie+1 and @papeIndex*@pageSie


--执行存储过程
GetPageList 2,5

原文地址:https://www.cnblogs.com/tong775131501/p/3821866.html