Life is memorable. Share your experience. Help others. Return the favor.
Terms Of Use
Privacy Policy
About
FAQ
Help
Contact Us
As an Amazon Associate and affiliate with other third parties, Echofavor earn from qualifying purchases and display advertisements.
0.221536
Exclusive access could not be obtained because the database is in use Sql Server Restore Failed - System.Data.SqlClient.SqlError
Possibly save 1 hour of your time: This happens when I try to restore a database.
First, make sure your destination is pointing to the right database name. In my case, the destination is a new database I created. And I use the source from a backup .bak file.
Under Files menu, I forgot to check the box for Relocate all files to folder. This will restore to the right location on your machine. So enter the data file folder and log file folder. Under Restore As column, make sure it is pointing to correct mdf and log file name. Under column Restore As, you may need to change the name of the mdf and log file to the same name as the one your database use.
If the above doesn't work, try the following. Go to Options right away and check the box Close existing connections to destination database. I also choose Overwrite the existing database. I also uncheck Take tail-log backup before restore.
|
Copyright © Echofavor 2021. All Rights Reserved. | Powered by Echofavor |