Error: System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing ” database. (Microsoft.SqlServer.Smo)


Error: System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing ” database. (Microsoft.SqlServer.Smo)

Description: While creating or restoring a database from an old backup of another server, we get this error in SQL Server Management Studio. That means there is difference in target and source database.

Solution: Couple or more ways to restore the database.

  1. Delete the database, add a new database with same name as source database name. Then try restoring it.
  2. Using command RESTORE DATABASE followed by WITH REPLACE.

      RESTORE DATABASE MyDB FROM DISK = 'E:\MyDB.bak' WITH REPLACE

      

3.  Right click on Database, choose Restore then Database. Go to Options tab and choose Overwrite the existing database (WITH REPLACE).

Leave a comment