Sql-server – Database ‘XXX’ is in transition. Try the statement later

sql server

im trying to connect to a sql server database i get this error

Database 'XXX' is in transition. Try the statement later.

i cancelled a long query earlier today but for some reason i can't get the database to get back up. Is there anything i can do?

Best Answer

This can happen sometimes if you try to take a DB offline or perform certain other operations and they fail. Sometimes the lock can be cleared if you close the SSMS instance that attempted the operation, then reopen it. Close and reopen any SSMS instances attached to the server.

It can also occur if you try to take the DB offline while a long query is running. Check the activity monitor and try killing any long-running queries, if applicable and safe.

If neither of the above works, close all SSMS instances, then restart SQL through the SQL Server Configuration Manager. Usually that will cure it, although the DB may be in recovery mode at first.