declare @onecount int
set @onecount=10000
print getdate()
while 1=1
begin
delete top(@onecount) from ysh where date<‘2016-06-21‘ ;
--处不能写任何语句 print也可能导致无法全部删除
IF (@@rowcount<@onecount) BREAK;
print getdate()END
2024-01-12 11:34:04
declare @onecount int
set @onecount=10000
print getdate()
while 1=1
begin
delete top(@onecount) from ysh where date<‘2016-06-21‘ ;
--处不能写任何语句 print也可能导致无法全部删除
IF (@@rowcount<@onecount) BREAK;
print getdate()END