One of my databases is in single user mode, and i can't seem to switch it to multi user.
USE master
GO
ALTER DATABASE MyDB
SET MULTI_USER WITH ROLLBACK IMMEDIATE
GO
When I run the above query, i get the following result
Changes to the state or options of database 'MyDB' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.
I've tried to query SQL Server from the master database to find all active connections to MyDB (exec sp_who
), but when i do so i get the following error
Database 'MyDB' is already open and can only have one user at a time.
What am i supposed to do to exit single user mode?