If you have problems with the SQL Server database or Windows Internal Database, make sure that the WSUS database in question is in the correct SQL instance before starting to troubleshoot SQL issues.
Troubleshooting database issues
Ensure that the WSUS database is in the correct SQL instance
To ensure that the WSUS database is in the correct SQL instance
Verify the SQL server name by opening a command window and typing the following:
Reg query "HKLM\SOFTWARE\Microsoft\Update Services\Server\Setup" /v SqlServerName
The output contains the SQL server name to be used in the next step.
Type the following:
sqlcmd -S SqlServerName -E -d SUSDB
Review any error messages and correct the problems.
If you are using Windows Internal Database as the WSUS database, use the following string in place of SqlServerName in the above command:
np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query