The following error was noticed while trying to restore the database while

TITLE: Microsoft SQL Server Management Studio

——————————

Restore failed for Server ‘SVR-COG-CON-DB’. (Microsoft.SqlServer.SmoExtended)

ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)

Reason:

The database that I was trying to restore was actually being used by another session at that time. So the restore process was stopped to avoid conflicts.

Solution:

1. Open the Activity Monitor

Right click on the Server Instance name and click on the Activity Monitor

2. Once the Activity monitor is opened check for the particular database (in my case SV-dev) under the Database column.

 

3.Right-click on the particular database that you are trying to restore and click on Kill Process. This will kill the process and allow you to restore the database.

<