Generate bulk SQL from Excel tables and input data into the database

Source: Internet
Author: User

Excel table has a lot of data, you need to import data into the database, not a manual input, you can generate SQL, to bulk operations.  

 1. First in the second row of the H column, insert the function: =concatenate ("insert INTO ' book ' (' BookID ', ' title ', ' volume ', ' Author ', ' Urlpdf ') VALUES ('", A2, " ', ' ', B2, ' ' ', ' 3 ', ', ' C2, ' ', ' ', F2, ' '); '), which represents fetching data from each column into a function.  

2. Write h2:h100 in the upper left, indicating that in H column, from the function automatically generate 2 rows to 100 rows, press Ctrl+enter, select the specified column: 

3. Move the cursor to the end of the FX function above and press Ctrl+enter to generate the SQL statement: 

at the end of the H column at the top of the "H" label, right-click on the copy, the successful copy of all the SQL statements, and then the SQL statement executed in the database is OK, successfully input Excel table data into the database.  

Generate bulk SQL from an Excel table and enter data into the database

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.