EXEC spGetObsoleteUpdatesToCleanup

If you want to check the progress of RemoveObsoleteUpdates (assuming you’re using the Windows Internal Database [WID]), you can open up SQL Server Management Studio using Run As Administrator, connect to the WID using the string below with Windows Authentication:

WID2008 = ‘np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query’
WID2012Plus = ‘np:\\.\pipe\MICROSOFT##WID\tsql\query’

Open a new query window and paste in the following code.

EXEC spGetObsoleteUpdatesToCleanup

This will return the number of rows left to process. Mark the number of rows down and then re-run this in an hour. Take note of the new number of rows and then subtract this number from the first number to find out how many records per hour it is doing. Then you can gauge how long it’s going to take.

If you want to speed up the process, stop the WSUS Service and it will speed up a bit.