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.
- Delete the database, add a new database with same name as source database name. Then try restoring it.
- 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).