sql2008 "Database backup in Backup set differs from existing XX database" workaround

Source: Internet
Author: User
Tags mssqlserver name database

Because it is in another computer to the same name database backup, using the usual method to restore, prompt is not the same database, do not let restore, find the following method on the Internet to solve:

First, right-click the system database master, new query

Execute the following SQL code:

RESTORE DATABASE xxxfrom DISK = ' E:\DB\xxx.bak '   --bak file path with replace,move ' xxx ' to ' D:\Program Files\Microsoft SQL Se Rver\mssql10_50.mssqlserver\mssql\data\xxx.mdf ',   --mdf file path move ' xxx_log ' to ' D:\Program Files\Microsoft SQL Server\mssql10_50.mssqlserver\mssql\data\xxx.ldf '   --ldf file path

Note: XXX is the name of the database you need to restore, Xxx.bak is the backup file you need to restore.

Second, the above method after successful execution, only some of the table structure has been restored, and there is no data in the table, then you can use the system default method and then use the Xxx.bak file to restore the database once you are done, you must select the overwrite restore OH.

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.