Set Database from Signle User Mode to Multi User in Microsoft SQL Server 2012

I encountered this error while making copy of the database in Microsoft SQL Server Management studio 2012. Server was a Virtual Machine and was stuck in the middle of the operation. After i aborted the operation the database was switched to single user. Server was not letting to switch the database from single user to multi-user. I took under given steps to overcome this issue.

Blocked all the connections from outside to this SQL server using windows firewall.

select

d.name,

d.dbid,

spid,

login_time,

nt_domain,

nt_username,

loginame

from sysprocesses p

inner join sysdatabases d

on p.dbid = d.dbid

where d.name = ‘dbname’

GO

Used the above code to get the PID of the database

kill 56

used the above command to kill the process and followed the under given instructions to switch the database to multi-user.

right-click on the Database > Properties > Options > [Scroll down] State > RestrictAccess > select Multi_user and click OK.

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.