Friday, December 9, 2016

Database Struck in single user mode and cannot drop

Execute below script to find SPID which is holding the process


Use Master
GO
Select * from master.sys.sysprocesses
Where spid > 50
            And dbid=DB_ID (‘DBName’))  -- replace with your database name
Once you identified the spid to KILL, you can simply execute:
KILL 85 – replace the spid with the one returned
Then try to bring it back into multi-user role

ALTER DATABASE StuckDb SET MULTI_USER
GO

No comments:

Post a Comment