Import an existing database from a SQL backup file

Source: Internet
Author: User
Tags sql window backup

The SQL itself has data import operations. However, if you want to import data from a backed-up file, you need to do another operation. Here is an example to illustrate.

There is already an DOE database on the SQL Server, and there is a lot of data, is ready to be from another backup file A1.bak (not the DOE database backup files) in the import of additional data (that is, after the import of the DOE to add some data tables, the table has recorded data), and maintain the original DOE data unchanged.

1. First, create a new temporary database A1 in SQL Enterprise Manager.

2, right click A1 Database, select: All Tasks-> Restore the database.

3. In the "Restore Database" window, select: "From Device."

4, click "Select Equipment".

5, click "Add".

6, from the filename to select the database file to restore, such as A1.bak.

7, click "OK" and return to the "Restore Database" window.

8, click the "Options" card, enter the option settings.

9. Hook selection: "Force restore on existing database".

10, modify "Move to physical file name" as: "C:\a1.ldf", "C:\a1.mdf".

11, click OK, you can import the data from the backup file into the staging database A1.

12. At this point, you can import data from A1 into another database that you really want to import, such as the DOE database.

(The following data import operation is a general data import export operation for SQL2000 Enterprise Manager.) )

13. In SQL Enterprise Manager, select the "DOE" database.

14, right click Doe Database, select: All Tasks-> Import data.

15. In the DTS Import/Export Wizard window, in select data source, the data source selects the staging database A1 that just created and imported the data. Click Next.

16, in the "choice of purpose", the system has been default to the DOE database.

17, continuously click "Next" until completed.

With the above operation, you have successfully imported the data from the backup file A1.bak into the DOE database, and the original data of the DOE database is unchanged.

At this point, 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.