0

I'm using SQL Server Bulk Insert to import a .csv file but my .csv has double quotation marks enclosing text fields. Is it possible to remove the quote marks whilst importing the data?

7
  • Double quotes are used to enclose text that might contain commas that shouldn't be considered a separating value. If you do remove them, make sure the commas are still treated correctly. Commented Feb 14, 2017 at 16:13
  • FIELDTERMINATOR ='","' is what you are looking for I think. However, you will be left with the first and last column having a quote in it. You can fix this with REPLACE() function after you bring the data into a TEMP TABLE prior to inserting it into your DB Tableor use a FORMAT FILE with your BULK INSERT to avoid this all together. They can be annoying though. Commented Feb 14, 2017 at 16:13
  • stackoverflow.com/a/25732545/6167855 Commented Feb 14, 2017 at 16:34
  • Thanks for your answer. I think a Format File may be the answer but what parameters would I set in the file to exclude the quotes. Commented Feb 14, 2017 at 16:35
  • Create a Format File, or, another article, and lastly, the answer I linked above was for a quoted field... just like yours Commented Feb 14, 2017 at 16:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.