Search code examples
sql-serverbackuprestore

RESTORE database with different name Fails - "The backup set holds a backup of a database other than the existing"


I have database backup A.bak I want to restore that backup file, using the SQL Server Management Studio, into database B which has all the same tables/columns but just different name. If I try to do the restore - I am getting error:

The backup set holds a backup of a database other than the existing

How can I resolve this? I tried renaming the .bak file but it didn't work


Solution

  • Specify the "Overwrite the existing database (WITH REPLACE)" option:

    WITH RELPACE option