0

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?

Anton Gildebrand
  • 3,641
  • 12
  • 50
  • 86

1 Answers1

-1

Use this:

exec sp_dboption 'db_name_here', 'single user', 'FALSE'
robertw
  • 724
  • 7
  • 20