problem when loading the bulk insert data from csv file to sql table

  • hi,

    i am facing problem with import the data from csv file to sql table through the Bulk insert statement.

    table having identity property,

    my table name sample_test

    I am using query is ,

    BULK INSERT sample_test From 'E:\sample_DataLoad\sample_data\Test1.csv'

    WITH

    (

    KEEPIDENTITY,

    firstrow =2,

    FIELDTERMINATOR = ',',

    ROWTERMINATOR = '',

    )

    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 2, column 1 (id).

    can you please post a solution for how can i solve this one.

    thanks in advance

    radh

  • I've sent you a pm on this one.

    I compare being a DBA to that of Smokey The Bear. Helping to prevent wildfires in your forest of servers and applications.

  • SQL_Ninja (9/7/2011)


    I've sent you a pm on this one.

    Why not post your answer here?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • A lot of the time, the bulk insert scripts that people post are missing chunks of info because of certain string combo's get filtered automatically. It is easier for me to offer assistance via PM's/Email for these types of issues.

    More than likely, it is a data issue in the file, a malformed end of line character, or an undefined eol character in his script.

    I compare being a DBA to that of Smokey The Bear. Helping to prevent wildfires in your forest of servers and applications.

Viewing 4 posts - 1 through 3 (of 3 total)

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