Convert data in Excel to SQL statements

Source: Internet
Author: User

if the Excel table has a, B, c three columns of data, you want to import into the Database Users table, the corresponding fields are Name,sex,age, add a column in your Excel table, and use Excel's formula to automatically generate SQL statements, the method is as follows:
1. Add a column to your Excel table
2, in the first row of column D, is D1 input formula: =concatenate ("INSERT into Persons_serial_number (Persons_no, Persons_name,id_number) VALUES (' & B1 & ', ' ' & C1 & ' ', ' ' & E1 & '); ')
3. At this point, D1 has generated the following SQL statement: INSERT into Persons_serial_number (Persons_no, Persons_name,id_number) VALUES (' xxxxx ', ' xxxx , ' xxxxxxxxxx ');
4. Copy the formula of D1 to column D of all rows by placing the data in the bottom right corner of the cell, and when the mouse becomes a 10 glyph, drag down to the last line to release it and automatically copy and change the parameters in values dynamically .
5. At this point, the D column has generated all the SQL statements
6. Copy the D column to a plain text file,It is recommended to use UltraEdit for processing.

Convert data in Excel to SQL statements

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.