Every once in a while I find myself typing a one-off script to import some CSV data into a database, doing some column logic (e.g. turn column3 into uppercase) and/or field mapping (column2 in the csv goes to column 3 in de database, etc).
Is there a nice tool which can do this easier?
The least amount of features I'd need is:
SQL server management studio can almost do it, except one can not specify any defaults for values which are not listed in the csv file. So I'd then have to create extra columns in excel first.
take a look at 6 ways to import data into SQL Server for some ideas, I think SSIS
would be your best bet..but there is a learning curve. Or BCP
into a staging table, massage the data there and then import intio the real table
The definitive "best" tool for importing and exporting data to and from SQL Server is, in my opinion, the BCP utility.
Do NOT be put off by the fact that there is no graphical user interface available to you. This tool exposes the widest range of functionality to the coder and also delivers the best performance of all SQL Server ETL Tools, fact.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With