大数据量可以用得的删除方式(实战)


 declare @a int
declare @b int
declare @total int
    select @a =11375038
    select @b =11395038  
  while @b< 164049168--164049168
  
  begin
  select @a=@a+20000
  select @b=@b+20000
 select  @total=(select count(*)  from [Archiveaaaaa] where siteid=  564 and id between @a and @b)
print @total
  delete from [Archiveaaaaa] where siteid=  564 and id between @a and @b
 print '删除成功'
  end
原文地址:https://www.cnblogs.com/chenli0513/p/1856324.html