SQL: SQL Server database stuck in single user mode
There was a question on Stack Overflow recently about SQL Server being “stuck” in single user mode.
The poster had a SQL Server 2016 instance, running on Windows Server 2016. He said he tried to do this:
ALTER DATABASE MyDatabase
SET MULTI_USER;
But it always told him that the database is in use.
The fix
The core concept to understand here is that when a database is in single user mode, you can’t assume that you’re the single user. In this case, he clearly wasn’t.
2020-02-20
