Importing an existing database from an SQL Server backup file

Source: Internet
Author: User
SQLServer has data import operations. However, if you want to import data from a backup file, you need to perform other operations. The following is an example. There is already a DOE database on the SQLServer server, and there is a large amount of data in it. Now we are going to import another one from another backup file A1.BAK (not the backup file of the DOE database ).

SQL Server itself has data import operations. However, if you want to import data from a backup file, you need to perform other operations. The following is an example. There is already a DOE database on the SQL Server, and there is a large amount of data in it. Now we are going to import another one from another backup file A1.BAK (not the backup file of the DOE database ).

SQL Server itself has data import operations. However, if you want to import data from a backup file, you need to perform other operations. The following is an example.

There is already a DOE database on the SQL Server and there is a large amount of data in it. Now we are going to prepare another backup file A1.BAK (not the backup file of the DOE database) import other data (that is, add some data tables to the DOE after the import, the table has already recorded data), and keep the data of the original DOE unchanged.

1. First, create a temporary database A1.

2. Right-click Database A1 and choose all tasks> Restore database.

3. In the "Restore database" window, select "Slave Device ".

4. Click "select device ".

5. Click "add ".

6. Select the database file to be restored from the file name, such as A1.BAK.

7. Click "OK" and return to the "Restore database" window.

8. Click the "options" tab to go to option settings.

9. Select "Force restore on existing database ".

10. Change "move to physical file name" to "c: a1.ldf" and "c: a1.mdf ".

11. Click OK to import the data in the backup file to the temporary database A1.

12. Now, you can import data from A1.

(The following data import and export operations are the general data import and export operations of SQL2000 Enterprise Manager .)

13. Select the "DOE" database in "SQL Enterprise Manager.

14. Right-click the DOE database and choose all tasks> import data.

15. In the "DTS import/export wizard" window, "Select data source", select the temporary database A1. Click Next.

16. In "select target", the system is already a DOE database by default.

17. Click "Next" until it is complete.

After the above operations, you have successfully imported the data in the backup file A1.BAK into the DOE database, and the original data of the DOE database remains unchanged.

In this case, you can delete the temporary database A1.

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.