Search code examples
sqlsql-serverdatabasedatabase-administrationadministrator

How to change database from Single user mode to multi user


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?.


Solution

  • 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.