标签:
1 ----分页查询@pageIndex第几页 @pageSize一页有几条记录 2 create proc GetPageList 3 @pageIndex int, 4 @pageSize int, 5 @rowsCount int output 6 as 7 begin 8 select @rowsCount= COUNT(*) from StudentInfo 9 select *from 10 (select *,ROW_NUMBER() over(order by stuId) 11 as rowIndex from StudentInfo) as stu1 12 where rowIndex between (@pageIndex-1)*@pageSize+1 and @pageIndex*@pageSize 13 end 14 --执行查询过程 15 declare @temp int 16 exec GetPageList 2,2,@temp output 17 print @temp
标签:
原文地址:http://www.cnblogs.com/clcloveHuahua/p/5229359.html