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).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s