Import XML file data to SQL [original]

Source: Internet
Author: User
When designing a database, we can choose to save our data table structure and data in XML format for ease of operation. There are many advantages, such as simple design and easy operation. You can develop an application for designing database tables on your own. Program Directly operate on XML files. In fact, another advantage is that it is easy to import XML data into any database we want in the end, but note that the design method here is only simple, it is impossible to achieve the functions of other specialized tools, but it is not a good way to practice your own design ideas. One of the following methods is used to import SQL statements from XML:
(1) first select a file that includes the data table structure and data that we have designed.
(2) The transit database we selected is access2003, which is very popular.
(3) Open access2003
(4) Open: file-Get External Database-guide

(5) Select an XML file in the pop-up dialog box, that is, the file with the data structure and data you designed.

(6) Click start to enter the "Import XML" dialog box. The table structure in your xml file is displayed.

(7) OK-complete

(8) At this time, the entire XML file is imported to access. The following shows that a table has been imported in the view.

(9) Now we can verify whether the data is complete. The access empty database we created is stored in C: \ db1.mdb. The following query statement can be used to display the data we need.

Check that we have found that the table structure and data are exactly the same as the one we designed previously.
(8) The data structure and data are all accessed. How can this problem be solved ......

In this way, we can create a new table named newtable in the data we want. All the fields in the table are automatically completed and the data is imported!
However, there is a problem: we have not managed the type and size of data fields throughout the process, so after we finally import XML data to SQL, you will understand the data types of all your fields.
Don't forget to tell me which of your friends has a good solution.

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.