Thursday, July 16, 2009

Restore failed - Microsoft SQL Server Management Studio

Are you getting an error while trying to restore Microsoft SQL Database via Microsoft SQL Server Management Studio?Additional information (Error Message)
System.Data.SqlClient.sqlError: Exclusive access could not be obtained because the database is in use (Microsoft.SqlServer.Smo)

Lets see what you need to do to solve this problem...
Reason for this error is most of the time database will be used by a program. You just have to kill that so database will be free to restore.

Right click on the Database after login in to the Microsoft SQL Server Management Studio with right previlages. Select Rasks and go to Detach. In general page you will see the database you have right clicked with a Message saying how many active connections are. Click on the message will pop up a new window with the Process info.

Right click on the process and kill Process will free the database to restore.
Blog Widget by LinkWithin