Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCP Error - Importing

Status
Not open for further replies.
Mar 27, 2001
29
0
0
US
Having an issue, and wrestling match, with BCP import function … and it’s winning.

Here is the command I am using. Have already created the output file using BCP without a hitch.

============================================================
Bcp reports..calendar2 in cal_out.txt –Usa –Prpt4m3 -Sreports –c
============================================================

This is the message that comes back after I invoke it from the command line.

Starting copy …

SQLState = 22001, NativeError = 0
Error = [Micrsoft][ODBC SQL Server Driver]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Micrsoft][ODBC SQL Server Driver]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Micrsoft][ODBC SQL Server Driver]String data, right truncation
SQLState = 22001, NativeError = 0
Error = [Micrsoft][ODBC SQL Server Driver]String data, right truncation
SQLState = S1000, NativeError = 0
Error = [Micrsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP data-file

0 rows copied
Network packet size (bytes): 4096
Clock Time (ms.): total 127687

============================================================
Here are some more stats on the operation:

FileName is: cal_out.txt and resided in the root directory (C:)
FileSize is: 711,652,316 bytes
TableCopiedFrom: Calendar
TableCopyingTo: Calendar2
ServerName: Reports
PassAndUser: sa/rpt4m3

============================================================

Have found that SQL2000 has a similar issue but not sure with SQL7. Both on an NT4 platform running the current SPs. Any and all help would be appreciated!!!
Thanks for all the help ... As Usual

J. Kusch
Chameleon Solutions, Inc.
 
Hi James,

The error messages that you are seeing are:

SQLState = 22001, NativeError =
Error = [Micrsoft][ODBC SQL Server Driver]String data, right truncation

This means that you are trying to insert a string field that is longer than the size in your new table (e.g. trying to post 40 chars into a 30 char field). BCP will ignore these errors, and as the message states, truncate everything to the right of the last character it can ignore.

SQLState = S1000, NativeError = 0
Error = [Micrsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP data-file

This means that BCP does not understand your file format, so you need to tell BCP your field delimitier. To do this, add the command -t'field delimiter' to your BCP command line.

HTH

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top