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. 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. Ideally 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
I have tried -r
and still it doesn't work until I open it and save it.
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 ........ FROM TEST.Jobs" QUERYOUT "c:Testjobs.csv" -T -c -t, -r