Classic Solution for SQL Server 2005 database restore Errors _mssql

Source: Internet
Author: User

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!

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.