Import CSV file to a Database, quickly

Challenge: you have a csv file and you need to import it into a new table in a database. You have 5 mins to get it done. What tools do you use?

@secretgeek

Below are many different solutions to this common problem, for a variety of databases and operating systems.

Table of contents:

Any database with any OS

Some brute force approaches (common!)

Any database with Windows

Any Database with MacOS

(No examples available, so use solutions for "Any database with any OS")

MS SQL Server Specific

SQLite specific

MySQL specific

Postgresql specific

Two techniques: Copy command in sql itself, and \copy command in psql (interactive commandline).

Oracle specific

Hadoop specific

Alternative: Just treat the CSV as SQL

♥ Love CSV? Hate CSV? Try NimbleText for your CSV transforming needs.

See also