Created
August 31, 2020 22:14
-
-
Save villian/8d5f08f669234b99a9d75526ca377e0b to your computer and use it in GitHub Desktop.
Umbraco 7: Cleaning out UrlTracker
This file contains 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
SET NOCOUNT ON; | |
DECLARE @r INT; | |
SET @r = 1; | |
WHILE @r > 0 | |
BEGIN | |
BEGIN TRANSACTION; | |
DELETE TOP (10000) -- this will change | |
From dbo.icUrlTracker | |
Where RedirectNodeId is null | |
and RedirectUrl is null | |
SET @r = @@ROWCOUNT; | |
print N'ROWCOUNT: '+ cast(@r as varchar(20)) | |
COMMIT TRANSACTION; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following SQL script will purge all 404 records, but retain the existing redirects:
Delete from icUrlTracker
Where RedirectNodeId is null
and RedirectUrl is null