I can't seem to restore a bak file to the same server but a new database. It works fine if I do it on another computer. I use SQL Server 2012 through SSMS. Everytime I do it it says Exclusive access could not be obtained because the database is in use, even though it's a nonexistent destination database.
Here are the steps:
- Right click Databases
- Restore Database...
- [General] Source from Device, select the bak file
- [General] Change the Destination database name to a new name
- [Files] Change mdf and ldf Restore As paths to a different, new path
- [Options] (unnecessary on the other computer) Check Overwrite the existing database (WITH_REPLACE)
- [Options] (unnecessary on the other computer) Check Close existing connections to destination database
- Click OK
This is the error message:
Restore of database 'DELVIPROD_JUNE' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)
System.Data.SqlClient.SqlError:Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.SmoExtended)