Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

@sergiosgc Nope. There are several ways of doing this. Using the GUI is the easiest, and the most common method. You can use SSIS, or the bcp command.

For example:

bcp "SELECT blah... FROM blah" queryout C:\..\blah.csv -c -t, -T –S<servername>



I have spent quite a bit of time in the past trying to import CSV data to SQL Server. It's just about possible, but bcp (and its format files) are absolutely horrifying. As far as I could tell, other methods of importing data involved either having access to put files onto the server so it could read them or getting SSIS to work - both pretty much impossible in a large organisation.


If there was one thing the author was right about it was MSSQL's poor CSV support. BCP doesn't handle escaping special characters in CSV (e.g. commas, quotes, tabs if you using tabs as delimiter).




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: