Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    France
    Posts
    1

    Question Unanswered: Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation

    Hi !

    I'm trying to load data in sql server table with Bulk Copy Program (BCP).

    I have the following errors.

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

    In my File to load i have this :

    Hello1¤Hello2¤17/02/2004
    TOTO1¤TOTO2¤17/02/2004
    TITI1¤TITI2¤17/02/2004

    My definition table is :

    create table tab1
    (
    TABLE varchar(20) null ,
    PK varchar(50) null ,
    DATE datetime null
    )
    go

    I launch bcp with this command :

    bcp.exe "BASETEST.dbo.tab1" in "c:\tab1.out" -c -CRAW -t¤ -m100 -Smyserver -U -P -o"c:\tab1.log"

    The file "table1.out" is making with a C program.

    Do you have an idea ?

    Thanks.

  2. #2
    Join Date
    May 2003
    Location
    UK
    Posts
    220
    Howdy

    Try including ' 00:00:00' on each date value.

    Cheers,

    SG

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •