create proc P_table as declare @N int --行数 set @n=0 declare @nn int set @nn=0 select identity(int,1,1) as idd,* into #t from yourtable select @nn=max(idd) from yourtable while @n>@nn begin select * from #t where between @n and @n+10 --可以显示10中 --可以处理10行数据,不知你想怎么处理。 set @n=@n+10 endgo
as
declare @N int --行数
set @n=0
declare @nn int
set @nn=0
select identity(int,1,1) as idd,* into #t from yourtable
select @nn=max(idd) from yourtable
while @n>@nn
begin
select * from #t where between @n and @n+10 --可以显示10中
--可以处理10行数据,不知你想怎么处理。
set @n=@n+10
endgo