I'll teach you-----. Using Excel to generate SQL statements in batches, processing large amounts of data

Source: Internet
Author: User

when doing the system or project, often encounter such requirements: the user sent us some data, asked us to import this data into the number of

According to the library, for a small amount of data, with the most primitive method can be solved, directly in the SQL with statements to achieve, but if there are thousands of

What about the data? If you continue to write SQL statements alone, it is estimated that you will have the impulse to jump from a dozens of article, there are two simple ways:

1, the Excel data collation, through the import function of SQL directly into the database, but to ensure that the database field and Excel fields consistent.

2. Generate the appropriate SQL statement from Excel and then put it into a new SQL query and execute it. Here's how to use this method:

We want to import the following 20 data into the database, a single insert, too slow, I am a lazy person, want to lazy, can only think of other law son.


In Excel's E1 cell, write a SQL statement that you can simply write:

INSERT into TableName (column1,column2,column3) VALUES (' Value1 ', ' Value2 ', ' Value3 ')


Then directly from the beginning to the end, you will find all the data have a corresponding script, and then directly copy the relevant SQL statements, into the parser, F5,ok, the task is complete!

A little experience, and share with you, it is a time to share, to share with each other, help each other and improve together.


I'll teach you-----. Using Excel to generate SQL statements in batches, processing large amounts of data

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.