Skip to content

Instantly share code, notes, and snippets.

@villian
Created August 31, 2020 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save villian/8d5f08f669234b99a9d75526ca377e0b to your computer and use it in GitHub Desktop.
Save villian/8d5f08f669234b99a9d75526ca377e0b to your computer and use it in GitHub Desktop.
Umbraco 7: Cleaning out UrlTracker
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
@villian
Copy link
Author

villian commented Aug 31, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment