Bulk Insert

  • Hi dear friends,

    I uploaded data on my sql server in a lacks of rows with the help of bulk insert T-SQL. After execution of my query, I checked from my table there is 10 rows are missing. How i can chek those rows which is missed or not inserted.

    Pls help me out....

    my query was like this,

    BULK INSERT OrdersBulk

    FROM 'c:\file1.txt'

    WITH

    (

    FIRSTROW = 2,

    MAXERRORS = 0,

    FIELDTERMINATOR = ',',

    ROWTERMINATOR = ''

    )

    Thanks in Advance.

    Regards,

    M.I.

    ________________________________________
    M.I.
    [font="Times New Roman"]

    Learning is a path with no destination...
    [/font]

  • Try this:

    BULK INSERT OrdersBulk

    FROM 'c:\file1.txt'

    WITH

    (

    FIRSTROW = 2,

    MAXERRORS = 0,

    FIELDTERMINATOR = ',',

    ROWTERMINATOR = '',

    ERRORFILE = 'c:\file1_error.txt'

    )

    Alex S
  • AlexSQLForums (10/14/2009)


    Try this:

    BULK INSERT OrdersBulk

    FROM 'c:\file1.txt'

    WITH

    (

    FIRSTROW = 2,

    MAXERRORS = 0,

    FIELDTERMINATOR = ',',

    ROWTERMINATOR = '',

    ERRORFILE = 'c:\file1_error.txt'

    )

    After run this query i got this error,

    Msg 4861, Level 16, State 1, Line 1

    Cannot bulk load because the file "c:\file1_error.txt" could not be opened. Operating system error code 80(error not found)

    ________________________________________
    M.I.
    [font="Times New Roman"]

    Learning is a path with no destination...
    [/font]

  • You need to create file named file1_error.txt under C drive before you run your code.

    MJ

  • ya i was created still i am not getting any error messages in that...

    M.I.

    ________________________________________
    M.I.
    [font="Times New Roman"]

    Learning is a path with no destination...
    [/font]

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

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