Friday, 19 July 2013

RESTORE cannot process database 'X' because it is in use by this session

When running a restore database query, I got the above error in SQL Management Studio. This was due to having the database 'X' selected in the dropdown list of databases, as suggested by the second part of the error message, which stated "It is recommended that the master database be used when performing this operation."

I changed the dropdown to another database 'Y' and was able to re-run the query without error.

No comments: