bcp error

  • I face a problem wich is when try to bulk insert give me the following error

    Msg 4864, Level 16, State 1, Line 1

    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 1 (x).

    Msg 4864, Level 16, State 1, Line 1

    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 1 (x).

    Msg 4864, Level 16, State 1, Line 1

    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 3, column 1 (x).

    the target table and source table have the same datatype

    for example

    CREATE TABLE [try] (

    [x] [int] NULL ,

    [y] [char] (10)

    ) ON [PRIMARY]

    GO

    the bcp bulc copy I use is :

    bcp master.bcp.%1 out c:\%1.txt -N -S1.1.1.1 -UXXX -PXXX -C1252 -r -t,

    the bulk insert code is :

    BULK INSERT [try]

    FROM 'c:\try.txt'

    WITH

    (

    FIELDTERMINATOR = ',',

    ROWTERMINATOR = ''

    )

    example of the data in the source table

    1 ,Ali

    2, Mahmoud

    Any help please

  • Well, no one has responded yet, and, admitedly, I can't say why you are getting your errors, but I would suggest trying to use a format file. You can find some information about them in BOL, or on Google.

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply