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.
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
SQL Server 2012:
right-click on the DB > Properties > Options > [Scroll down] State > RestrictAccess > select Multi_user
and click OK.
Voila!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With