New Post has been published on Varinder Sandhu 's Blog
New Post has been published on http://www.varindersandhu.in/2012/03/08/sql-server-error-3154-the-backup-set-holds-a-backup-of-a-database-other-than-the-existing-database/
SQL Server - Error 3154: The backup set holds a backup of a database other than the existing database
Sometime we faced the following error message while restoring the database
Error 3154: The backup set holds a backup of a database other than the existing database.
Use WITH REPLACE while using the restore script as
<!-- google_ad_client = "pub-2404605494811633"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "FFFFFF"; google_color_link = "0000FF"; google_color_bg = "FFFFFF"; google_color_text = "000000"; google_color_url = "008000"; google_ui_features = "rc:6"; //-->
RESTORE DATABASE YourDB FROM DISK = 'C:\YourDB.bak' WITH REPLACE
-- Get the Logical file name of the database from backup. RESTORE FILELISTONLY FROM DISK = 'C:\YourDB.bak' GO RESTORE DATABASE YourDB FROM DISK = 'C\:YourDB.bak' WITH MOVE 'YourDB_Data' TO 'C:\Database\YourDB.mdf', MOVE 'YourDB_Log' TO 'C:\Database\YourDB.ldf', REPLACE
Delete the older database which is conflicting and restore again. It will work.