Home Forums Programming General bcp leaves field terminator at end of line RE: bcp leaves field terminator at end of line

  • I'm not sure what you're doing or how you're getting that. Maybe you have an empty column at the end which simulates a trailing comma.

    Using this code, I didn't got the comma.

    BCP.exe "Test.dbo.Table" Out "C:\Table.csv" -c -t"," -SMyTestServer -T -m10 -e"C:\Table.err" -o"C:\Table.out"

    I noticed that you posted slashes instead of dashes and you had the data_file in an incorrect position. I'm using a trusted connection because I have Windows Authentication, but you're including user and password for SQL Server Authentication so that's the only difference which shouldn't affect the file format.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2