Last active
August 7, 2020 18:57
-
-
Save xavierzwirtz/f15cb9d61b9ced50e826e69571ed8b5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- run this for both tables | |
-- BDTriggerAuditBDPageHits | |
-- BDTriggerAuditBDCarts | |
SET NOCOUNT ON; | |
DECLARE @r INT; | |
SET @r = 1; | |
WHILE @r > 0 | |
BEGIN | |
BEGIN TRANSACTION; | |
DELETE TOP (1000) from | |
dbo.BDTriggerAuditBDCarts | |
WHERE AuditTime < '2020-7-1' | |
SET @r = @@ROWCOUNT; | |
COMMIT TRANSACTION; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment