I have a database that is stuck in Single User mode after a failed restore process. I have checked the sysprocesses table and none of the processes have spid > 50. They are all sa processes. Using the following code returns a deadlock that I can not seem to clear:
ALTER DATABASE myDatabase SET MULTI_USER with NO_WAIT
Besides restarting the SQL Server and then spamming the Alter statement, is there a way for me to pull this out of single user mode? Thanks in advance for any help you can provide.
Best Answer
Apart from what Shawan referenced, another option is to use DAC
ADMIN:ServerName
then issue below command (note that I am not using NO_WAIT)
From BOL :