Home
.. About WSUS Wiki

RSS

WSUS
.. WSUS FAQ
.. WSUS on SBS
.. WSUS Troubleshooting
.. WSUS News Groups
.. Known WSUS Issues
.. WSUS Links
.. WSUS Wish List

WSUS Documents
.. WSUS Deployment Guide
.. WSUS Installation Guide
.. WSUS Release Notes
.. WSUS Best Practice

SUS
.. SUS FAQ
.. What Is SUS
.. SUS Troubleshooting
.. SUS Links
.. SUS Known Issues
.. SUS FAQ
.. What Is SUS
.. SUS Troubleshooting
.. SUS Links
.. SUS Known Issues

Wiki Community
.. Wiki Contributors
.. I Love WSUS
.. WSUS Wiki Diary
.. Wiki Statistics
.. To Do Page

Miscellaneous Stuff
.. Other Resources
.. Do You Know?

Site Meter


Terms of Use
Trademarks
Privacy Statement

 

Stored Procedure to Delete Declined Updates


I recently ran into a DB issue I believe was caused by the Windows Internal DB containing too much data at about 3500 clients.  The result was that the server approved an update when it syncronized with Microsoft although it was not configured to do so.  I also noticed that it downloaded files for all lanagues even though we only have a few enabled.  To correct this problem I wrote a Stored Procedure to delete all updates that have been declined.


DROP TABLE #Delete_keys 

USE SUSDB 

CREATE TABLE #Delete_Keys(guid varchar(255))

DECLARE @loop as int, @guid as uniqueidentifier

SET @loop = 0

INSERT INTO #Delete_keys (guid)
SELECT UpdateID
FROM PUBLIC_VIEWS.vUpdate
WHERE IsDeclined = 'True';

WHILE @loop = 0
BEGIN
  SELECT TOP(1) @guid = guid FROM #Delete_keys
 IF @guid IS NULL
  SET @loop = 1
 ELSE
  EXEC spDeleteUpdateByUpdateID @guid
  DELETE FROM #Delete_keys WHERE guid = @guid
END

DROP TABLE #Delete_keys


From what i've gathered no one has published a way to do this so I built a SP myself.  It uses the existing SP's built into WSUS 3 to perform the deletions so it should run cleanly.


NameVersionSizeDateUser
spDeleteDeclinedUpdates.sql449410/24/07 9:16 PMToddMurray
Corrected SQL



Last Modified 10/24/07 9:14 PM

Hide Tools