sql-server,database,multi-user,single-user
To get the session that was tied to the database I ran: SELECT request_session_id FROM sys.dm_tran_locks WHERE resource_database_id = DB_ID('mydb') This yielded a processid of 55 I then ran: kill 55 go And I was the able to use the alter multi_user line that was previously not working...
sql,sql-server,tsql,multi-user,single-user
It's been a while, but I believe the with rollback immediate option is there to say you want this to succeed no matter what. the normal behavior blocks until all running transactions have completed successfully. Also, setting the database to multi-user mode when it's already multi-user is safe. However, if...