SQL2008 "The database backup in the backup set is different from the existing "***' database" solution

Error resolution when SQLser2008 restores the database: SQL Server2008 reported an error when restoring the exported test-2021.bak database file: "System.Data.sqlClient.sqlError. The database backup in the backup set is different from the existing "test-2021" database. "

[Solution]
       Sql Server 2008 restores the database file, it cannot be restored according to the restore steps in Sql Server 2000 (sql2000 restore is to create a database with the same name and then restore to this database), that is, you cannot create a new database with the same name as the restored database , The correct restoration method is described as follows:
1. Delete the newly created database in the original operation, such as deleting the existing'test -2021 ' database;


2. Right-click "Database" and select "Restore Database";


3. Enter the target database in the window that appears, for example, enter test-2021 , and select "Source Device", click the browse button, click the "Add" button, and select the Sql Server backup file test-2021.bak ;


 
4. Click the "OK" button to go to the initial window, tick the check box in the "Restore" column before the file, and click OK;


5. After clicking the "OK" button, the database is restored successfully, and you can see the " test-2021 " database file in the database list .