More and more often it seems that the WSUS DB becomes too large that it causes multiple issues especially with SCCM integration (SCUP). You may not be able to perform the required maintenance using scripts (Download Here) but often enough the service will crash thus you will need to troubleshoot at the SQL/WID level to perform a cleanup.
SQL/WID Cleanup Queries
Download the scripts here and run in order:
SQLQuery – 1 Remove Unused Updates
SQLQuery – 2 Remove Hidden Updates
SQLQuery – 3 Re-index Database
If your SUSDB is on a dedicated SQL Instance, connect to that server/DB and run the SQL Queries.
If you are running Windows Internal Database, this will still require SQL Management Studio (Run As Administrator)
Server Name to connect to
2012 (or later) \\.\pipe\MICROSOFT##WID\tsql\query
2003 & 2008 \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query