
You are performing a SQL database restoration but end up with the below error message,
Restore of database 'SID' failed
The file 'xxxxxx.mdf' cannot be overwritten.
It is being used by database 'SID'

Solution
Depending on your requirement, please refer to the following scenarios.
Scenario A
You have created an empty database ABC and you want to restore ABC with the existing backup of XYZ database.
Go to the Files page, adjust the location of mdf, ndf and ldf. Do not use the same location as the existing database.

Scenario B
You have an existing XYZ database and you want to restore XYZ database with ABC backup.
Go to the Options page and select Overwrite the existing database (WITH REPLACE).




that did not fix the .mdf file being used by another database