Skip to content

Instantly share code, notes, and snippets.

@dsolodow
Last active February 14, 2024 18:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dsolodow/0e83003a19db69daef28 to your computer and use it in GitHub Desktop.
Save dsolodow/0e83003a19db69daef28 to your computer and use it in GitHub Desktop.
Delete WSUS Sync History
DELETE FROM [SUSDB].[dbo].[tbEventInstance]
WHERE [EventID] IN (381,382,384,386)
@gsaldana71
Copy link

Thanks! This worked beautifully. I tried others but this one did the trick. Do you have one that leaves the most recent synchronizations??

@miasik
Copy link

miasik commented Oct 19, 2017

@gsaldana71, try this for one last week:
DELETE FROM [SUSDB].[dbo].[tbEventInstance] WHERE ([EventID]=381 or [EventID]=382 or [EventID]=384 or [EventID]=386 or [EventID]=387) and TimeAtServer < (DATEADD (week , -1 , getdate() ))

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