WSUS wont load after win updates were istalled on the same server

The server thats is also running WSUS failed to install its updates and was stuck in Win Logo screen.
The only way i could get it to boot is to manually remove all pending updates using DISM cmd.
From this guide.

Now my server boots but WSUS is not working. I think some other updates may have been removed which made the WSUS install older than the WID database
I cant load the mmc, i tried deleting the mmc file. But it wont connect its complaining about the DB.
And also running the post install steps failed saying the DB is not same version as WSUS and I need to patch WSUS
C:\Windows\system32>"C:\Program Files\Update Services\Tools\wsusutil.exe" postinstall /servicing
Log file is located at C:\Users\administrator\AppData\Local\Temp\2\tmpF11.tmp
Post install is starting
Fatal Error: Changes to the state or options of database 'SUSDB' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.
ALTER DATABASE statement failed.

Since the issue is on WSUS server it cant update it self
Right now im trying to point it to MS Updates and get the latest updates from Internet instead if it self.

Here are some errors I see in event log.

Error      4/14/2018 5:04:07 PM      MSSQL$MICROSOFT##WID      18056      Server
Error      4/14/2018 5:01:59 PM      Windows Server Update Services      12042      9
Error      4/14/2018 5:01:59 PM      Windows Server Update Services      12032      9
Error      4/14/2018 4:43:47 PM      Windows Server Update Services      507      1
Error      4/14/2018 4:43:02 PM      Windows Server Update Services      7053      None
Warning      4/14/2018 4:37:23 PM      Windows Server Update Services      7032      None
Ideally id like to fix this without loosing my WSUS db or data.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun VermaakTechnical Specialist/DeveloperCommented:
Try to exit single user mode with SQLCMD.exe

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
baysysadminAuthor Commented:
Ive never used that exe before, is it located somewhere on the server?

Today i noticed WSUS service crashed on its own (not that it was working right to begin with)

Even with service off, the post install cmd returns

Fatal Error: Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
ALTER DATABASE statement failed.

In task manager there is no PID 51 so what could be locking the DB?

even if I figure out how to run the sqlcmd.exe you gave me, i imagine it wont work when its locked by another process.
baysysadminAuthor Commented:
I had to install SQL Manager on this DC, and was able to connect via GUI


I could not alter state because it was locked by PID 51 so I ran a kill cmd along with alter and that worked.
my WSUS console connects now.

kill 51 
alter database SUSDB set multi_user;

Open in new window

Im testing now to see if my servers connect to WSUS

Shaun VermaakTechnical Specialist/DeveloperCommented:
What process was id 51?
baysysadminAuthor Commented:
it was for SUSDB i dont know what in detail, i didnt drill into it.

It wasnt the WSUS Service, because that was off.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.