Currently, my database is in Single User mode. When I try to expand me database, I get an error:
The database \'my_db\' is not accessible.(ObjectExplo
First, find and KILL all the processes that have been currently running.
Then, run the following T-SQL to set the database in MULTI_USER mode.
USE master
GO
DECLARE @kill varchar(max) = '';
SELECT @kill = @kill + 'KILL ' + CONVERT(varchar(10), spid) + '; '
FROM master..sysprocesses
WHERE spid > 50 AND dbid = DB_ID('')
EXEC(@kill);
GO
SET DEADLOCK_PRIORITY HIGH
ALTER DATABASE [] SET MULTI_USER WITH NO_WAIT
ALTER DATABASE [] SET MULTI_USER WITH ROLLBACK IMMEDIATE
GO