SQL Restore Failed For Server – Exclusive Access Could Not Be Obtained Because The Database Is In Use

When restoring a SQL server database, you may get the following error:

Restore failed for server. Exclusive access could not be obtained because the database is in use. RESTORE DATABASE is terminating abnormally (MICROSOFT SQL Server, Error: 3101)

This error occurs because the database you are trying to restore is in use. Ie: Someone is running a query against it. The easiest way to fix this is to:

  1. Right click the server in SQL Server Management Console and click Activity Monitor.
  2. Click on Processes.
  3. Right click all processes running against the database you are trying to restore and click Kill Process.

If you are using an older version of SQL, you won’t have the Activity Monitor so you will have to detach the SQL database and check Drop Connections to close any existing connections before restoring.

You should then be able to restore the SQL database as it will no longer be in use.

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)
SQL Restore Failed For Server - Exclusive Access Could Not Be Obtained Because The Database Is In Use, 9.0 out of 10 based on 1 rating

Leave a comment

Your email address will not be published. Required fields are marked *