系统自带的隐藏分页存储过程在sql2005 无法使用create    PROC sp_PageView   
@sql         ntext,     --要执行的sql语句
@PageCurrent int=1,     --要显示的页码
@PageSize    int=10,    --每页的大小
@PageCount   int OUTPUT --总记录
AS
SET NOCOUNT ON
DECLARE @p1 int
--初始化分页游标
EXEC sp_cursoropen 
    @cursor=@p1 OUTPUT,
    @stmt=@sql,
    @scrollopt=1,
    @ccopt=1,
    @rowcount=@PageCount OUTPUT--计算总页数
IF ISNULL(@PageSize,0)<1 
    SET @PageSize=10
IF ISNULL(@PageCurrent,0)<1 OR ISNULL(@PageCurrent,0)>@PageCount
    SET @PageCurrent=1
ELSE
    SET @PageCurrent=(@PageCurrent-1)*@PageSize+1--显示指定页的数据
EXEC sp_cursorfetch @p1,16,@PageCurrent,@PageSize--关闭分页游标
EXEC sp_cursorclose @p1
GO在sql2000 正常使用, sql 2005 无法使用..
 请问有解决办法吗 ?, 分不够可以再发~

解决方案 »

  1.   

    sp_cursoropen2000里面这些过程都没查到呀,晕,网站上搜索一下分页存储过程
    提示什么错误吗
      

  2.   

    http://topic.csdn.net/u/20080715/14/b55dc336-aefd-441b-b4e6-30a196195cda.html分页存储过程,参考里面,
      

  3.   

     嗯. 查不到, 在sql 2005的查询分析器可以正常使用, 前端调用的时候 就没有数据了 ~