set rowcount 10
while exists(select 1 from Dv_topic where Boardid=75)
delete from Dv_topic where Boardid=75
set rowcount 0
while exists(select 1 from Dv_topic where Boardid=75)
delete from Dv_topic where Boardid=75
set rowcount 0
set rowcount 500
while exists(select 1 from Dv_topic where Boardid=75)
delete from Dv_topic where Boardid=75
set rowcount 0
set nocount off
delete from Dv_topic where Boardid=75
while @@rowcount>0
delete from Dv_topic where Boardid=75
set rowcount 0
while exists(select 1 from Dv_topic where Boardid=75)
delete from Dv_topic where Boardid=75
set rowcount 0
--如果保留的记录很少,建议用临时表来处理删除select * into #t from Dv_topic where Boardid<>75
truncate table Dv_topic
set xact_abort on
begin tran
insert Dv_topic select * from #t
drop table #t
commit tran