Unanswered: bcp in loads less records but does not give any error
I have a bcp format file as under
1 SYBCHAR 0 10 "" 1 A
2 SYBCHAR 0 1 "" 2 B
3 SYBCHAR 0 1 "" 3 C
4 SYBCHAR 0 1 "" 4 D
5 SYBCHAR 0 4 "\n" 5 E
When i load a file with this format file ..i get reduced records...while debugging i found that some rows have 10 character and then new line while some rows have 13 characters and newline
This is what is happening
1. For 10 characters bcp is concatenating the second record with the first and copying its values i.e. 2 file records stored as one 1 in database.
2. For 13 character records it is storing 1 record only in database with the last field as null...
The question is
why is next record not bieng concatened in 2nd case since it expects 17 characters totally.
If the answer is that it encounters a new line so my second question would be that it encounters new line after 10 characters in the first case also why does it concatenate the next record
My guess is that that for 10 character since it is expecting a character so it concatenates the next row while after 13 characters since it encounters a newline which is the field terminator so it puts a null in that field
Just wanted to confirm whether i am thinking on the right track