Chris Fuller  

SQL Server 2005 Restore Error: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)

Posted by Chris Fuller
Friday, December 4, 2009

I do a lot of prototyping, so I am backing up, moving and restoring SQL Server databases a lot. We are using SQL Server 2005.

I recently ran into this error:


I shut down all services and applications using the database, and I still got it. I then noticed that I had a query window open in Enterprise Manager. I closed all of the query windows, tried again and was able to restore successfully.

Hind sight is always 20/20 - duh, the query windows open a connection to the database - but when you work in Enterprise Manager a lot, as I do, it's easy to forget something like that.

Lesson learned.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home