I challenged my twitter peeps:
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?
and was overwhelmed with the responses! So many different ways people approach the problem, and so many different tools.
It reminds me of Miles' Law:
Where you stand on an issue depends on where you sit.
- If you sit in python all day, you'll write a python script.
- If you sit in powershell all day, you'll use powershell
- If you sit in SQL Server all day, you might use T-SQL itself to do the work.
- If you sit in an editor all day, you might use search/replace to transform the data into sql statements.
I put all the solutions I saw into my "today I learneds" site, here's a table of contents for the topic:
- Import CSV file to a Database, quickly
- Import CSV file to any database with any OS
- Import CSV file to any database with Windows tools
- Import CSV file to any Database with MacOS
- Import CSV file to MS SQL Server
- Import CSV file to SQLite
- Import CSV file to MySQL
- Import CSV file to Postgresql
- Import CSV file to Oracle
- Import CSV file to Hadoop
- Alternative: Just treat the CSV as SQL
In related CSV-news I should mention that I made a git repo: "Awesome CSV" where I collect all the coolest CSV tools, articles and specs from around the planet. It's a happening place for cool people to hang out and learn cool things.
I also have an Awesome GUID repo, where I store awesome things related to GUIDs. There are surprisingly few things there. Hmmm.
* Whenever someone says 'arguably' it is safe to replace it with 'not'. This is arguably true in every circumstance.