摘要:
create procedure [dbo].[SqlPager]@sqlstr nvarchar(4000), --查询字符串@currentpage int, --第N页@pagesize int, --每页行数@rowcount int outasset nocount ondeclare @P1 int --P1是游标的idexec sp_cursoropen @P1 output,@sqlstr,@scrollopt=1,@ccopt=1, @rowcount=@rowcount outputselect ceiling(1.0*@rowcount/@pagesize) as 总页数 阅读全文