hello world!!!!!

写下自己的一些心得,写下自己问题的方式,写下程序之路的艰辛,希望能够有朝一日成为大牛。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

Posted on 2010-10-20 09:48  陈力  阅读(221)  评论(0编辑  收藏  举报

 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