How to change database from Single user mode to multi user

SqlLearner picture SqlLearner · Jul 30, 2014 · Viewed 45.8k times · Source

I have a Database,Which is in Single user mode ,If i want to access a tables in the database i will be changing in the properties from single to multiuser.How can i make the Database multi user permenantly?.

Answer

Kris Gruttemeyer picture Kris Gruttemeyer · Jul 30, 2014

ALTER DATABASE [MyDB] SET MULTI_USER

If it throws an error like user is already connected to it, select 'master' db in the dropdown and try it that way.

If that doesn't do it, use sp_who to find what spid is accessing the DB and kill it.