S
S
Samyrro0542020-10-16 10:09:24
SQLite
Samyrro054, 2020-10-16 10:09:24

C#: Importing a large csv file into a SQLite DB. How to do it?

Please tell me a good way to migrate big data (1M rows, 12 columns) from csv file to SQLite database (without resorting to loop iterations, slow and inefficient).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-10-16
@Samyrro054

https://www.bricelam.net/2017/07/20/sqlite-bulk-in... .
https://stackoverflow.com/questions/364017/faster-...
Install pragmas

synchronous = OFF + locking_mode = EXCLUSIVE + journal_mode = OFF

And use a batch insert of 50,000 items

S
Sergey Karbivnichy, 2020-10-16
@hottabxp

Try the sqlite console utility (Gui may hang):

sqlite> create table mytable(a, b);
sqlite> .mode csv
sqlite> .import myfile.csv mytable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question