declare @d1 datetime,@d2 datetime
declare @s varchar(8000),@i int
set @s = '0'
set @i = 1
while @i<800
begin
 set @s = @s+','+right('000000000'+rtrim(@i),9)
 set @i=@i+1
end
declare @centers varchar(8000)
set @centers = @s+','
set @d1 =getdate()
while len(@centers)>0
begin
print left(@centers,charindex(',',@centers)-1)
--取出每个之后想做删除操作
--delete from t where ID = ?
set @centers=right(@centers,len(@centers)-charindex(',',@centers))
end
set @d2 =getdate()
print '长度:'+rtrim(len(@s))
print '耗时:'+rtrim(datediff(ms,@d1,@d2))+'毫秒'
/*
长度:7991
耗时:340毫秒
*/