--每次删多少 DECLARE @BatchSize INT = 100 WHILE 1 = 1 BEGIN DELETE TOP (@BatchSize) FROM tb WHERE id>30 IF @@ROWCOUNT < @BatchSize BREAK END
2023-12-23 21:00:09
--每次删多少 DECLARE @BatchSize INT = 100 WHILE 1 = 1 BEGIN DELETE TOP (@BatchSize) FROM tb WHERE id>30 IF @@ROWCOUNT < @BatchSize BREAK END