Sybase bcp Unexpected EOF enco
Today, when testing the batch import data of bcp, there will be errors in err.txt after each data import. The error content is as follows:
Unexpected EOF encountered in BCP data-file.
Bcp copy in partially failed
Enter the contents of bcp.sql as follows:
Bc | | 1 | | 2010-07-27 1414 4000 &
Bc | | 1 | | 2010-07-27 1414 4000 &
Bc | | 1 | | 2010-07-27 1414 4000 &
Bc | | 1 | | 2010-07-27 1414 4000 &
Bc | | 1 | | 2010-07-27 1414 4000 &
Bc | | 1 | | 2010-07-27 1414 4000 &
Bc | | 1 | | 2010-07-27 1414 4000 &
Bc | | 1 | | 2010-07-27 1414 4000 &
The bcp command is as follows
Bcp tt in. / bcp.sql-Unms-Penetmanager-SSYBASE-c-t'| |'- ringing roommates'- b10 >. / err.txt 2 > & 1
The line Terminator is set to & &, which still reports that error after testing for a long time. After tossing about for a long time, I remembered that there was an invisible newline character at the end of each line, and the command was changed to
Bcp tt in. / bcp.sql-Unms-Penetmanager-SSYBASE-c-t'| |'- ringing rooms &\ n'- b10 >. / err.txt 2 > & 1
The problem has been solved. Sure enough, it was caused by an invisible return.