Import Excel data to DB database

Method 1: Import CSV file:

1. Copy the data to Excel;
2. Save the data in Excel, select CSV format;
3. Use the database tool (SQLiteStudio.exe), select the table (need to build the table in advance), right-click and select [Import to this Table], the next step, select the csv file to complete.

Method 2: Use Excel functions

Enter the formula in the first row of the last column of Excel:

=CONCATENATE("INSERT INTO PERSONS_SERIAL_NUMBER(PERSONS_NO, PERSONS_NAME,ID_NUMBER) VALUES('" & A1 & "', '" & B1 & "', '" & C1 & "');")

Will automatically generate sql statement:

 INSERT INTO PERSONS_SERIAL_NUMBER(PERSONS_NO, PERSONS_NAME,ID_NUMBER) VALUES('1', 'B0703', '二轮车');

Go to the database tool and execute these insert statements in batches.

Reference: https://blog.csdn.net/lifuxiangcaohui/article/details/46332967

Published 45 original articles · Like 24 · Visits 50,000+

Guess you like

Origin blog.csdn.net/zhijiandedaima/article/details/95337826