I'm trying to import a correctly quoted CSV file, meaning data is only quoted if it contains a comma, e.g.:
41, Terminator, Black
42, "Monsters, Inc.", Blue
I observe that the first row imports correctly, but the second row errors in a manner that suggests the quoted comma was treated as a field separator.
I have seen suggestions such as this one
to change the field terminator
FIELDTERMINATOR='","'
However, my CSV file only quotes fields that need it, so I do not believe that suggestion would work.
Can SQL Server's BULK IMPORT statement import a correctly quoted CSV file? How?
Unfortunately SQL Server interprets the quoted comma as a delimiter. This applies to both BCP and bulk insert .
From http://msdn.microsoft.com/en-us/library/ms191485%28v=sql.100%29.aspx
If a terminator character occurs within the data, it is interpreted as a terminator, not as data, and the data after that character is interpreted as belonging to the next field or record. Therefore, choose your terminators carefully to make sure that they never appear in your data.