Sql 连续性提交
-----------
declare row_num number := 0; begin for gyj_test in(select id from gyj_test1 t where xx is null) loop delete from gyj_test1 where id=gyj_test.id; row_num := row_num +1; ---2000条提交一次,可根据需要修改 if mod(row_num,2000) = 0 then commit; end if; end loop; commit; end;
declare @min int
declare @max int
declare @actid NUMERIC
set @min=0 --从0开始
set @max=300 --循环次数
set @actid= 1000000003228041
while @min<@max
BEGIN
waitfor delay '00:00:03'
delete FROM plan_scst WHERE fscprdid = '1912' AND actid <=@actid
set @min=@min+1
set @actid=@actid+5000
SELECT @min --打印执行结果
END
-----------

浙公网安备 33010602011771号