yuanweisen

 

分页SQL脚本

alter proc trunpage
@pageindex int
as
declare @table varchar(1000),@retTable varchar(4000)
set @table='select * from jobs '
set @retTable='select top 2 * from ('+@table+') a  where job_id not in (select top '
+cast((@pageindex-1)*2 as varchar(20))+' job_id from jobs )'
print @retTable
exec (@retTable)

posted on 2009-04-04 15:19    阅读(145)  评论(0编辑  收藏  举报

导航