How to solve if SQL database struck in Restoring state

Sometimes, even during a simple task like Database backup and restore could be tricky because of a strange error. That is how IT works. During one such operation, I have observed that the Database was struck in Restoring state . And no SQL operations were working on the DB with the usual error message: " The database is not accessible for the user " and " The database is currently in use ". If you have a database backup, which most probably you will have if you were trying to restore the database - you can follow the below steps as a solution: Execute the dbcc detachdb (' Your database name ') The observation made here is that, the GUI way to detach the database does not work. However, when you run this command - you will receive an error message when you execute. However the database is dropped which gives you a scope to attach the database again. Now use the database backup with you to restore the database again. Maybe try to use RECOVERY while...