Set database from SINGLE USER mode to MULTI USER

That error message generally means there are other processes connected to the DB. Try running this to see which are connected:

exec sp_who

That will return you the process and then you should be able to run:

kill [XXX]

Where [xxx] is the spid of the process you're trying to kill.

Then you can run your above statement.

Good luck.


You can add the option to rollback your change immediately.

ALTER DATABASE BARDABARD
SET MULTI_USER
WITH ROLLBACK IMMEDIATE
GO

The “user is currently connected to it” might be SQL Server Management Studio window itself. Try selecting the master database and running the ALTER query again.

Tags:

Sql

Sql Server