Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-11-04 : 09:25:42
|
| Ray D writes "Hi SQLTeamI have an ascii file which contains 34 pipe delimited fields which I am using to import into a table with 37 columns using bcp. The ascii file contains data for columns 1 - 34 in the same order as my table definition. I am using a format file to tell bcp not to populate the additional columns in my table. The prefix lengths in the the format file for the fields to be imported have been set to allow NULL values and the columns in the table have been set to allow NULL values. The 3 columns not to be imported are specified in the format file with their lengths , prefix and server column order set to 0. The format files row terminator is set to \r\n which I have checked is at the end of each row in the ascii file. When I run the bcp statement I receive the error "Unexpected EOF encountered in BCP data file". I think part of the problem might be that the last field in the data file is not the last column in the table and as such I have to specifiy the end of row terminator before the last field is specified.end of format file.34 SQLDATETIM4 1 4 "\r\n" 34 invoice_date ""35 SQLFLT8 0 0 "" 0 margin1 ""36 SQLFLT8 0 0 "" 0 margin2 ""37 SQLCHAR 0 0 "" 0 spare Latin1_General_BINAny ideas ? Thanks in advance " |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-11-04 : 10:03:01
|
| I think the BCP data file is your data, not the bcp.fmt?I've had the same error when I had two blank lines, rather than one, at the end of the data file.Sam |
 |
|
|
|
|
|