An error occurred during a SQL Server 2005 database restore: Database backups in the backup set are different from the existing ' XXXX ' database, and several solution tests have been found on the web, which are finally successfully restored, and are hereby documented and provided to those in need.
First step:
If you know the backup database name you can skip the first step, if you do not know the name of the backup database, you can first execute the following statement:
RESTORE filelistonly from disk = ' f:\ path \css_cms1 '--Backup database file path name
This allows you to list the data and log file names in the file, knowing that the two file names can be followed next.
Step Two:
If you know the database name of the backup database, you can create a database with the same name, and then use the statement to perform the restore, such as the database data file is Xxx_data,log file is Xxx_log, then you create the XXX database. Then execute the SQL statement:
Use master
Restore db css_cms from disk = ' F:\xx path \file '--backup database file pathname with
Replace, move N ' Xxx_data '
To n ' f:\ the path to be saved \data\xxx.mdf ', move
N ' Xxx_log ' to
n ' f:\ the path to save to \data\xxx.ldf '
This will enable the database to be restored successfully.
Knowledge about SQL Server 2005 database restore here, I hope you can have some harvest!