Quotes around data output in bcp command

  • Hello,

    I am exporting out of a SQL database into a CSV file. I forgot to mention in a earlier post that this export is done with a bcp command. I would like to put double quotes around the data. In the bcp command, I have tried -t"," but this does not work. I cannot put the quotes right into the query because that does not seem to work. I was wondering what I can do. Thank you for all of your help!

  • In the bcp command, I have tried -t"," but this does not work.

    What is the error you are getting? I have tried to use the -t"," doing a BCP OUT and i was able to successfully export out the table data. However, I have not attempted any bcp in, because i know it's going to fail. In my case, I know that in one of the field of the table i have just exported out, the pattern "," is possible to appear and that marks a field delimiter, and can split the data into two fields, and thus won't work for me, then i just have to find a more unique delimiter. I wonder if this is possible also on your data?

  • Actually the error comes when I try to import the CSV file into the MS Outlook calendar. I noticed that if you export the calendar from Outlook, all of the field names are in quotes. I just, on a hunch, thought that this may be why it got the error - because the bcp output had no quotes. I did finally get the quotes into the bcp output using Char(34).

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply