I'm trying to understand how to use a format file. I've created a
table named "tbl1" with 3 fields: first, second, third. All fields are
int. I've created also a table named "tbl2" with 2 fields: first,
third.
I'm running the bcp utility on tbl2 (export):
bcp dbName..tbl2 out "file_name" -Usa -n -P -E -T
I've created a format file:
7.0
3
1 SQLINT 0 4 "\t" 1 first
2 SQLINT 0 0 "" 0 second
3 SQLINT 0 4 "\r\n" 3 third
I'm running the bcp utility on tbl1 (import):
bcp dbName..tbl1 in "file_name" -fc:\format_file.fmt -Usa -n -P -E -T
It discards the format file and copies data into the "second" field
although I'm trying to ignore this field.
What is the problem?
Thanks
Erez
the column u see IS the third, not the second, but its a
bit difficult to see that, because the second column is not
only 0 Bytes long, but also has terminator "" ;))
try using a terminator like "\t", it could be an improof.
cheers
robert