Bloated WSUS Wreaking Havoc

Home Forums Server Operating Systems SBS 2000 / 2003 / 2008 / 2011 Bloated WSUS Wreaking Havoc

This topic contains 5 replies, has 4 voices, and was last updated by  joeqwerty 1 year, 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts

  • noRulez43
    Member
    #166946

    SBS 2011

    Our server has not been properly maintained in regards to wsus and now has about 35,000 obsolete updates that I need to delete. I found a script to do that but each update seems to be taking about an hour. I don’t have four years to wait for this thing to finish. I’ve stopped the wsus service. Is there anything else I can do to speed this up or should I get ready to go nuclear and uninstall and reinstall wsus? This is the script I’m using:

    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]USE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] SUSDB[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]DECLARE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @var1 [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080],[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @curitem [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080],[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @totaltodelete [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INT[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]DECLARE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @msg [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]nvarchar[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]200[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080])[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]CREATE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]TABLE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] #results4[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]Col1 [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080])[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INSERT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INTO[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] #results4[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]Col1[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080])[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]EXEC[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] spGetObsoleteUpdatesToCleanup[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]SET[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @totaltodelete [/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]SELECT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF00FF][SIZE=10px][COLOR=#FF00FF]COUNT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080](*)[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]FROM[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] #results4[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080])[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]SELECT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @curitem[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]1[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]DECLARE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] WC [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]Cursor[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]FOR[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]SELECT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] Col1 [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]FROM[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] #results4[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]OPEN[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] WC[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]FETCH[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]NEXT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]FROM[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] WC [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INTO[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @var1 [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]WHILE [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF00FF][SIZE=10px][COLOR=#FF00FF]@@FETCH_STATUS[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]>[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]-[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]1[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080])[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]BEGIN[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]SET[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @msg [/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF00FF][SIZE=10px][COLOR=#FF00FF]cast[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]@curitem [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]as[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]varchar[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]5[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]))[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]+[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF0000][SIZE=10px][COLOR=#FF0000]’/'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]+[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF00FF][SIZE=10px][COLOR=#FF00FF]cast[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]@totaltodelete [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]as[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]varchar[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]5[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]))[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]+[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF0000][SIZE=10px][COLOR=#FF0000]’: Deleting ‘[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]+[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF00FF][SIZE=10px][COLOR=#FF00FF]CONVERT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]varchar[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]10[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]),[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @var1[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080])[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]+[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF0000][SIZE=10px][COLOR=#FF0000]’ ‘[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]+[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF00FF][SIZE=10px][COLOR=#FF00FF]cast[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#FF00FF][SIZE=10px][COLOR=#FF00FF]getdate[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]()[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]as[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]varchar[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]30[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]))[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]RAISERROR[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]([/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]@msg[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080],[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]0[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080],[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]1[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080])[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]WITH[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]NOWAIT[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]EXEC[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] spDeleteUpdate[/SIZE][SIZE=10px]@localUpdateID[/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]@var1[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]SET[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @curitem [/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @curitem [/SIZE][SIZE=10px][COLOR=#808080][SIZE=10px][COLOR=#808080]+[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px]1[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]FETCH[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]NEXT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]FROM[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] WC [/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]INTO[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] @var1[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]END[/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]CLOSE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] WC[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]DEALLOCATE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] WC[/SIZE]
    [SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]DROP[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px][COLOR=#0000FF][SIZE=10px][COLOR=#0000FF]TABLE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=10px] #results4[/SIZE]
    [/CODE][CODE][SIZE=10px][SIZE=10px]USE[/SIZE][/SIZE][SIZE=10px] SUSDB[/SIZE]
    [SIZE=10px][SIZE=10px]DECLARE[/SIZE][/SIZE][SIZE=10px] @var1 [/SIZE][SIZE=10px][SIZE=10px]INT[/SIZE][/SIZE][SIZE=10px][SIZE=10px],[/SIZE][/SIZE][SIZE=10px] @curitem [/SIZE][SIZE=10px][SIZE=10px]INT[/SIZE][/SIZE][SIZE=10px][SIZE=10px],[/SIZE][/SIZE][SIZE=10px] @totaltodelete [/SIZE][SIZE=10px][SIZE=10px]INT[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]DECLARE[/SIZE][/SIZE][SIZE=10px] @msg [/SIZE][SIZE=10px][SIZE=10px]nvarchar[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]200[/SIZE][SIZE=10px][SIZE=10px])[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]CREATE[/SIZE][/SIZE][SIZE=10px][SIZE=10px]TABLE[/SIZE][/SIZE][SIZE=10px] #results4[/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]Col1 [/SIZE][SIZE=10px][SIZE=10px]INT[/SIZE][/SIZE][SIZE=10px][SIZE=10px])[/SIZE][/SIZE][SIZE=10px][SIZE=10px]INSERT[/SIZE][/SIZE][SIZE=10px][SIZE=10px]INTO[/SIZE][/SIZE][SIZE=10px] #results4[/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]Col1[/SIZE][SIZE=10px][SIZE=10px])[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]EXEC[/SIZE][/SIZE][SIZE=10px] spGetObsoleteUpdatesToCleanup[/SIZE]
    [SIZE=10px][SIZE=10px]SET[/SIZE][/SIZE][SIZE=10px] @totaltodelete [/SIZE][SIZE=10px][SIZE=10px]=[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px][SIZE=10px]SELECT[/SIZE][/SIZE][SIZE=10px][SIZE=10px]COUNT[/SIZE][/SIZE][SIZE=10px][SIZE=10px](*)[/SIZE][/SIZE][SIZE=10px][SIZE=10px]FROM[/SIZE][/SIZE][SIZE=10px] #results4[/SIZE][SIZE=10px][SIZE=10px])[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]SELECT[/SIZE][/SIZE][SIZE=10px] @curitem[/SIZE][SIZE=10px][SIZE=10px]=[/SIZE][/SIZE][SIZE=10px]1[/SIZE]
    [SIZE=10px][SIZE=10px]DECLARE[/SIZE][/SIZE][SIZE=10px] WC [/SIZE][SIZE=10px][SIZE=10px]Cursor[/SIZE][/SIZE][SIZE=10px][SIZE=10px]FOR[/SIZE][/SIZE][SIZE=10px][SIZE=10px]SELECT[/SIZE][/SIZE][SIZE=10px] Col1 [/SIZE][SIZE=10px][SIZE=10px]FROM[/SIZE][/SIZE][SIZE=10px] #results4[/SIZE]
    [SIZE=10px][SIZE=10px]OPEN[/SIZE][/SIZE][SIZE=10px] WC[/SIZE]
    [SIZE=10px][SIZE=10px]FETCH[/SIZE][/SIZE][SIZE=10px][SIZE=10px]NEXT[/SIZE][/SIZE][SIZE=10px][SIZE=10px]FROM[/SIZE][/SIZE][SIZE=10px] WC [/SIZE][SIZE=10px][SIZE=10px]INTO[/SIZE][/SIZE][SIZE=10px] @var1 [/SIZE][SIZE=10px][SIZE=10px]WHILE [/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px][SIZE=10px]@@FETCH_STATUS[/SIZE][/SIZE][SIZE=10px][SIZE=10px]>[/SIZE][/SIZE][SIZE=10px][SIZE=10px][/SIZE][/SIZE][SIZE=10px]1[/SIZE][SIZE=10px][SIZE=10px])[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]BEGIN[/SIZE][/SIZE][SIZE=10px][SIZE=10px]SET[/SIZE][/SIZE][SIZE=10px] @msg [/SIZE][SIZE=10px][SIZE=10px]=[/SIZE][/SIZE][SIZE=10px][SIZE=10px]cast[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]@curitem [/SIZE][SIZE=10px][SIZE=10px]as[/SIZE][/SIZE][SIZE=10px][SIZE=10px]varchar[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]5[/SIZE][SIZE=10px][SIZE=10px]))[/SIZE][/SIZE][SIZE=10px][SIZE=10px]+[/SIZE][/SIZE][SIZE=10px][SIZE=10px]‘/’[/SIZE][/SIZE][SIZE=10px][SIZE=10px]+[/SIZE][/SIZE][SIZE=10px][SIZE=10px]cast[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]@totaltodelete [/SIZE][SIZE=10px][SIZE=10px]as[/SIZE][/SIZE][SIZE=10px][SIZE=10px]varchar[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]5[/SIZE][SIZE=10px][SIZE=10px]))[/SIZE][/SIZE][SIZE=10px][SIZE=10px]+[/SIZE][/SIZE][SIZE=10px][SIZE=10px]‘: Deleting ‘[/SIZE][/SIZE][SIZE=10px][SIZE=10px]+[/SIZE][/SIZE][SIZE=10px][SIZE=10px]CONVERT[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px][SIZE=10px]varchar[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]10[/SIZE][SIZE=10px][SIZE=10px]),[/SIZE][/SIZE][SIZE=10px] @var1[/SIZE][SIZE=10px][SIZE=10px])[/SIZE][/SIZE][SIZE=10px][SIZE=10px]+[/SIZE][/SIZE][SIZE=10px][SIZE=10px]‘ ‘[/SIZE][/SIZE][SIZE=10px][SIZE=10px]+[/SIZE][/SIZE][SIZE=10px][SIZE=10px]cast[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px][SIZE=10px]getdate[/SIZE][/SIZE][SIZE=10px][SIZE=10px]()[/SIZE][/SIZE][SIZE=10px][SIZE=10px]as[/SIZE][/SIZE][SIZE=10px][SIZE=10px]varchar[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]30[/SIZE][SIZE=10px][SIZE=10px]))[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]RAISERROR[/SIZE][/SIZE][SIZE=10px][SIZE=10px]([/SIZE][/SIZE][SIZE=10px]@msg[/SIZE][SIZE=10px][SIZE=10px],[/SIZE][/SIZE][SIZE=10px]0[/SIZE][SIZE=10px][SIZE=10px],[/SIZE][/SIZE][SIZE=10px]1[/SIZE][SIZE=10px][SIZE=10px])[/SIZE][/SIZE][SIZE=10px][SIZE=10px]WITH[/SIZE][/SIZE][SIZE=10px][SIZE=10px]NOWAIT[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]EXEC[/SIZE][/SIZE][SIZE=10px] spDeleteUpdate[/SIZE][SIZE=10px]@localUpdateID[/SIZE][SIZE=10px][SIZE=10px]=[/SIZE][/SIZE][SIZE=10px]@var1[/SIZE]
    [SIZE=10px][SIZE=10px]SET[/SIZE][/SIZE][SIZE=10px] @curitem [/SIZE][SIZE=10px][SIZE=10px]=[/SIZE][/SIZE][SIZE=10px] @curitem [/SIZE][SIZE=10px][SIZE=10px]+[/SIZE][/SIZE][SIZE=10px]1[/SIZE]
    [SIZE=10px][SIZE=10px]FETCH[/SIZE][/SIZE][SIZE=10px][SIZE=10px]NEXT[/SIZE][/SIZE][SIZE=10px][SIZE=10px]FROM[/SIZE][/SIZE][SIZE=10px] WC [/SIZE][SIZE=10px][SIZE=10px]INTO[/SIZE][/SIZE][SIZE=10px] @var1[/SIZE]
    [SIZE=10px][SIZE=10px]END[/SIZE][/SIZE]
    [SIZE=10px][SIZE=10px]CLOSE[/SIZE][/SIZE][SIZE=10px] WC[/SIZE]
    [SIZE=10px][SIZE=10px]DEALLOCATE[/SIZE][/SIZE][SIZE=10px] WC[/SIZE]
    [SIZE=10px][SIZE=10px]DROP[/SIZE][/SIZE][SIZE=10px][SIZE=10px]TABLE[/SIZE][/SIZE][SIZE=10px] #results4[/SIZE]
    [/CODE]


    joeqwerty
    Moderator
    #304593

    Have you tried using the WSUS console to do this?


    Ossian
    Moderator
    #191603

    Also re-index your WSUS database using the script here:
    http://gallery.technet.microsoft.com/ScriptCenter/6f8cde49-5c52-4abd-9820-f1d270ddea61/


    noRulez43
    Member
    #284851
    joeqwerty;n510067 wrote:
    Have you tried using the WSUS console to do this?

    Thanks for the replies. I forgot to mention that I have been trying the console repeatedly but I’m not getting anywhere, it keeps timing out and I’ve verified that it isn’t actually deleting anything.

    Ossian, I’m running the re-index now and hoping for the best. Thank you.


    noRulez43
    Member
    #284852

    It took a while but I finally got the reindexing to run successfully. Unfortunately, I still can’t get the WSUS cleanup wizard to run and it is still taking forever to delete updates via the sql script mentioned above. Any other options?


    wullieb1
    Moderator
    #245609

    Nope. You could always blow it away and start again.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.