The backup set holds a backup of a database other than the existing & #39; xxdb & #39; database.

Source: Internet
Author: User
Tags mssqlserver

Zookeeper

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'Database. (Microsoft. SqlServer. Smo)
Above error message indicates that you are going to restore a database on another database which are not the same database. for example, you have backup A database and try to restore the backup to B database, the error will occur. you can use Overwrite the existing databaseOption while you're restoring to solve the problem. On Restore Database, Select OptionsTab on the left menu. Then, check Overwrite the existing databaseOn Restore options. Now Restore the database. and problem is solved. You can also delete the database and again restore that. Two: Use SQL to solve this issue.

USEmaster

RESTOREDATABASEReportServer

FROMDISK = 'C: \ Program Files \ Microsoft SQL Server \ MSSQL11.MSSQLSERVER \ MSSQL \ Backup \ ReportServer. Bak'

WITHMOVE '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 = 10, REPLACE

GO

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.