The backup set holds a backup of a database other than the existing ' xxdb ' database.time 2014-04-25 11:03:39 csdn blog Similar article (
0)
original http://blog.csdn.net/wzhiu/article/ details/24459511
One:
He backup set holds a backup of a database other than the existing ' xxdb ' database
Sometime when you try to restore the backup file on an existing database and receive the following error message:
Restore failed for Server ' SQL Server name '. (MICROSOFT.SQLSERVER.SMO)
Additional Information:
System.Data.SqlClient.SqlError:The backup set holds a backup of a database other than the existing ' xxdbe ' dat Abase. (MICROSOFT.SQLSERVER.SMO)
Above error message indicates that is going to restore a database on another database which is not the same database . For example, you had backup A database and try to restore the backup to B database, the error would occur.
You can use the overwrite the existing database option while you're restoring to solve the problem.
On Restore Database , select Options tab on the left menu. Then, check Overwrite the existing database on the Restore options.
Now Restore the database. and problem is solved.
You can also delete the database and again restore.
Both:
Use the SQL to solve this issue.
Use master
RESTORE DATABASE ReportServer
From DISK = ' C:\Program Files\Microsoft SQL Server\mssql11. Mssqlserver\mssql\backup\reportserver.bak '
With MOVE ' reportserver_db ' to ' C:\Program Files\Microsoft SQL Server\mssql11. Mssqlserver\mssql\backup\reportserver.mdf ',
MOVE ' Reportserver_log ' to ' C:\Program Files\Microsoft SQL Server\mssql11. Mssqlserver\mssql\backup\reportserver_log.ldf ',
STATS = ten, REPLACE
GO
SQL Server Restore Script