Convert data in Excel into SQL statements and convert data into SQL statements

Source: Internet
Author: User

Convert data in Excel into SQL statements and convert data into SQL statements
If the excel table contains three columns of data: A, B, and C, and you want to import the data to the users table of the database, the corresponding fields are name, sex, age, add a column to your excel table and use the excel Formula to automatically generate SQL statements. The method is as follows:
1. Add a column to your excel worksheet
2. In column D of the first row, enter the formula = CONCATENATE ("insert into PERSONS_SERIAL_NUMBER (PERSONS_NO, PERSONS_NAME, ID_NUMBER) VALUES ('" & B1 &"', '"& C1 &"', '"& E1 &"');")
3. At this time, D1 has generated the following SQL statement: INSERT INTO PERSONS_SERIAL_NUMBER (PERSONS_NO, PERSONS_NAME, ID_NUMBER) VALUES ('xxxxxx', 'xxxx, 'xxxxxxxxxxxx ');
4. Copy the D1 formula to column D of all rows by placing the data in the bottom right corner of the cell. When the mouse turns into a cross shape, the data will be automatically copied when you drag it down to the last row, dynamically change the parameters in values
5. All SQL statements have been generated in column D.
6. Copy column D to a plain text file. We recommend that you use UltraEdit for processing.

Related Article

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.