ASPNETDB.mdf cannot be overwritten. It is being used by database ‘…’

You might encounter this error when you are trying to restore a database.
For other problems you may face during the procedure see my post.

Assuming you have other issues fixed, let's keep going with this one.

Open SSMS.
Right-click on the database you want to restore.
Follow Tasks->Restore->Database
“Restore Database” window opens.

For the 'Source' select 'Device' and browse to your .bak file.
For the 'Destination' select the database you want to restore.
Now on the left pane click “Files”.
You should see 2 files. ASPNETDB and ASPNETDB_log.
Double-click on “Restore As” values (cells) for each of them and change the files names to something else.

Now you should be able to restore.

Hope this helps someone.

Good luck,
Serdar

Leave a Reply

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