4 ms·
@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 ex
by blahblahOOO 12y ago
@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>
- rossng 12y agoI 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.
- duncans 12y agoIf 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).