Two Methods for importing data from an excel table to a SQL database

Source: Internet
Author: User

I recently studied the public platform. The boss handed in a temporary task to import the data in the excel table to the SQL database. I think this is so easy. I spent two days on it...

Introduction: the database has the following table (table)

I only retrieve key columns and there is a lot of data in them.

There is an excel file (table B) that compares id and name with N structured excel tables (Table C) (the column without id)

My task finds the id corresponding to the data in Table C in Table B, then adds the id to Table C, and finally is unique according to the id, use the data in Table C to update the data in table. Conversion between an excel table and a database table is involved here.

Solution 1: use excel + MySQL for Excel

MySQL for Excel is a plug-in for directly operating mysql Databases in excel. You can modify the database like modifying an excel table, or merge tables. Install the plug-in.

When using this, I encountered a problem. MySQL for Excel can connect to a local database, but the database on the server is always not connected .... Solution 1 bankruptcy

Solution 2: import an excel table to the database and use SQL statements to perform operations.

Note that 2.1 indicates that the mobile phone number in the excel table must be set to the text format, and the second is to use traditional Chinese characters. When space is garbled, delete the space and rewrite the input.

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.