WSUS cleanup aborts

Mathias 56 Reputation points

Hi there,

I have a WSUS server with version 10.0.14393.2969. If I start the cleanup there and select "Unused updates and update revisions", the cleanup stops after 3 minutes with the error that the database is very busy. The same behavior also occurs when executing the cleaning script. I have already set the timeout in SQL to 0, but unfortunately no improvement. A SQL Server 2016 runs as the database on the system. The database is already 20 GB in size, which I think is quite large. About 7000 clients report to the WSUS. Does anyone have any idea what I can do to make the WSUS clean up again?

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,288 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rita Hu -MSFT 9,626 Reputation points

    Hi 38542140,

    Thanks for your posting on this forum.

    Please refer to the below steps to see whether this issue will be resolved or not:

    Method 1.Open the SSMS as an administrator and connect to the WSUS database.
    Right click on the server name, select Properties/Connections, set timeout from remote query timeout from 600 to 0 (= no timeout). Then run the server cleanup wizard again and wait for the results. It would take lots of time to complete.
    Reference picture:

    Method 2.We could run the following query in the SSMS to delete the unused updates and update revisions directly.

    DECLARE @var1 INT  
    DECLARE @msg nvarchar(100)  
    CREATE TABLE #results (Col1 INT)  
    INSERT INTO #results(Col1) EXEC spGetObsoleteUpdatesToCleanup  
    DECLARE WC Cursor  
    SELECT Col1 FROM #results  
    OPEN WC  
    INTO @var1  
    WHILE (@@FETCH_STATUS > -1)  
    BEGIN SET @msg = 'Deleting' + CONVERT(varchar(10), @var1)  
    RAISERROR(@msg,0,1) WITH NOWAIT EXEC spDeleteUpdate @localUpdateID=@var1  
    CLOSE WC  
    DROP TABLE #results  

    Hope the above will be helpful.

    Please remember to inform me if there are any updates.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

9 additional answers

Sort by: Most helpful
  1. Adam J. Marshall 8,886 Reputation points MVP

    Are you performing the proper WSUS maintenance including but not limited to running the Server Cleanup Wizard (SCW), declining superseded updates, running the SQL Indexing script, etc.?

    It's not just running the SCW that's needed (and yes, timeouts can occur if the other parts of maintenance is not done).

    1 person found this answer helpful.
    0 comments No comments

  2. Mathias 56 Reputation points

    Hi, thanks for your reply. I have already declined and removed all replacing updates. Then I ran the Windows cleanup script. Unfortunately it breaks off every time it is cleaned up. Then I also ran the SQL Reindex script but after that there was no improvement. Do you have another idea for me? If your tool would help me, then I would buy this.

    1 person found this answer helpful.

  3. Mathias 56 Reputation points

    Hi there,

    I've already heard the timeout set to 0, unfortunately no improvement. I have already removed manual deletion, but nothing is dealt with. What else can I do now, do the WSUS again or is there another solution?


    1 person found this answer helpful.

  4. Mathias 56 Reputation points


    I had set the value a long time ago, but it didn't bring anything either.


    1 person found this answer helpful.
    0 comments No comments