Hi,
I am having trouble using BCP to import into an SQL Server V6.0 table
on NT V3.5 using a data file with fewer columns than the table itself.
I am following the example on this in the 'MS SQL Server Administrator's
Companion' book, but I keep getting this error:
'Unexpected EOF encountered in BCP data-file'
My table is made up of 5 fields:
2 char;
1 int (4);
1 datetime (this is the field I am not importing).
However since my data file is binary I have declared the int field as SQLCHAR
(aswell as the datetime field) in the format file which I use when executing
BCP.
I have tried everything with the format file but to know avail.
PLUS:
I have tested a text file which contains values for all the fields in the table
and imported all of the fields successfully, however if I change
Host file data length to 0 and
Server column order to 0
for the datetime field, i.e. I am not importing into this field, I get the same
error, so I don't think it is any hidden character in the data file which may
be upsetting the import.
Is there some condition that I am missing?
Am I using the conflicting versions?
Can I import from a data file with fewer columns than table columns?
TIA,
John
Remember the syntex on the bcp line is case sensitive in some places.
Good Luck.
Dave , dgl...@connect3.com
After 7 rows SQLServer loses itself because there is no index. On top of
this, when I try to talk BCP into adding an index by appending unique
data to the file being loaded and separating columns with abitrary
strings, I get the same "BCP - Unexpexted EOF encountered in BCP
data-file".
Trying to load in to a table with a timestamp column yields the same
results too. Any ideas?
Thanks in advance.
Matthew Dodd
Phoenix Solutions