November 16, 2010 at 6:38 am
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!
November 16, 2010 at 6:53 pm
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?
November 16, 2010 at 7:38 pm
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy