--//我把它封装成一个存储过程,调用的时候方便的很哈!!
create procedure up_zbh_DivPageBySql
as
--SELECT @nRowCount AS nRecordCount, ceiling(1.0 * @nRowCount / @nPageSize) AS nPageCount, @nPageCount AS nPage
SET @nPageCount = (@nPageCount - 1) * @nPageSize + 1
EXEC sp_cursorfetch @P1, 32, @nPageCount, @nPageSize
EXEC sp_cursorclose @P1
GO
--//调用的方式
表
exec up_zbh_DivPageBySql 'select * from 表',10,3
存储过程
exec up_zbh_DivPageBySql 'exec 存储过程',10,1