CREATE procedure ProRobin
(@pagesize int,
@pageindex int,
@docount bit)
as
set nocount on
if(@docount=1)
select count(wzxxbm) from YBFLD
else
begin
declare @indextable table(id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
insert into @indextable(nid) select wzxxbm from YBFLD order by xlh desc
select O.* from YBFLD O,@indextable t where O.wzxxbm=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
end
set nocount off
GO

解决方案 »

  1.   

    偶老大有http://community.csdn.net/Expert/TopicView.asp?id=4016964
      

  2.   

    我寫了一年多的 Oracle SQL , PL/SQL(Procedure,存儲過程)
    看了樓主的要求,十分想幫助你,
    可是,我看不懂 SQL Sever 裡面的關鍵字 例如 Set .. On , AS , @
    能不能簡單說明一下?
      

  3.   

    cscyk(lover
       您能否将您的ORACLE分页的存储过程贴出来,我参考一下,我就是用ORACLE数据库。
    [email protected]
      

  4.   

    http://community.csdn.net/Expert/topic/4024/4024209.xml?temp=.1997339
      

  5.   

    cscyk(lover
       您能否将您的ORACLE分页的存储过程贴出来,我参考一下,我就是用ORACLE数据库。
    [email protected]
      

  6.   

    renyu732(Good Good Study,Day Day Up.) 
    我就是不能改。所以到网上来问。。