Sql Server: The backup set holds a backup of a database other than the existing (Restore failed)

There are few common tasks in SQL server that should work out of the box, but give errors that confuse less experiences developers. Like when you try to restore a backup from another server, you get:

Restore failed for Server ‘.\SQLEXPRESS’.  (Microsoft.SqlServer.SmoExtended)
System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing ‘SomeDb’ database. (Microsoft.SqlServer.Smo)

The solution could not be simpler: you should use WITH REPLACE option of RESTORE command, or in SQL Server Management studio select “Options” page and check “Overwrite the existing database (WITH REPLACE)”

2 thoughts on “Sql Server: The backup set holds a backup of a database other than the existing (Restore failed)

  1. I’m using ms sql 2005….in restore option if i choose to overwrite the database there is no RESTORE WITH REPLACE but there is RESTORE WITH RECOVERY. SO what if i choose RESTORE WITH RECOVERY

Leave a Reply

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