bisonn icon

Safe Delete

bisonn | PRO | 10/21/19 03:16:27 PM UTC | 0 ⭐ | 6735 👁️ | Never ⏰ | []
T-SQL |

280 B

|

None

|

0 👍

/

0 👎

use MO
 
declare @i bigint = (select max(id) from [_Log_QueryMO] where DateStart<getdate()-7)
set @i = 51700681
set nocount on
set rowcount 100000
set deadlock_priority low
select 1
while @@rowcount>0 begin 
    waitfor delay '00:00:00.2'
    delete [_Log_QueryMO] where id<@i
end
go

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎