Hi Expert DBA’s,
In Microsoft SQL server Management Studio when I try to restore the server failed to do. The error says the database is in use, but no one is using the database. I do not understand where I went wrong. Please guide me or help me to trap the error. Your help is great. Thanks.
Microsoft SQL Server Management Studio
Restore failed for Server ‘1 1’. (Microsoft.SqlServer.Smo)
Additional Information:
System.Data.SqlClient.Eeclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)
Answered By
points
N/A
#167956
Microsoft SQL Server Management Studio Restore Failed for Server Error
This error usually happens because of a process that was being used by the database has been unexpectedly terminated without releasing resources or other user/session that was using the database at the same time.
To fix this issue, first, try to restart the “SQL Server” service.
-
Go to Control Panel >> System and Security >> Administrative Tools >> Services.
-
Find out the service “SQL Server”.
-
Right-click on it and select “Stop”.
-
Once again, right-click and select “Start”.
If this process fails to fix your issue,
-
Find out other users who are using the same database. Execute this command:
Execute SP_WHO
-
Now, kill the process. To do so, execute:
Execute KILL 53
Here, “53” is the process ID. This will be found from “Execute SP_WHO”.
Now, there is no way that your database restoration will fail.