August 19, 2009 at 10:16 am
Can anybody please help. I am running a bcp query on SQL 2000 to export a csv file. The query works and creates the file no problem. But when I upload it to another application it doesn't like it (there's been no problems with csv files created elsewhere). However if I go back to my csv file, open it, click save (not save as), and close it, it uploads fine.
I have tried various combinations of switches, and still it has problems. I need to use a comma(,) as the fieldterminator (-t,) and a carriage return (0x0D) and a line feed (0x0A) as the row terminator (-r\r).
I have tried -r\r , -r\r , -r and still it doesn't work until I open it and save it. I have tried creating a format file and specifying it, but this doesn't work.
This needs to work as part of a batch script that can run unattended, so I was wondering if anybody can tell me any other switches I can use, or is there a way to do the open / save combination from the command line?
incidentally the script I am running is:
bcp "SELECT ...
August 20, 2009 at 4:24 am
I now know what the problem is, but not the solution yet. BCP, in it's infinite wisdom decides that all blank spaces (0x20) should be converted to null (0x00), which has caused havoc in the other application which doesn't know what to do with them.
Strangely when opening/saving/closing the document windows then decides to change them all back again!!
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply