BULK INSERT WITH IDENTITY COLUMN

  • I'm trying to insert a flatfile in a temporary table. (Every line in the file is a row in the table.) No problem until I want to know the order of how the lines where inserted in de the table. (I need to process the lines in the same order.) I have placed a identity column in my table, and then the problems came. When I run my code he always gave me the following error message: "Could not bulk insert because column too long in data file. Make sure FieldTerminator and RowTerminator were specified correctly." Apparently he is trying to put data in the identity column.

    Can anyone help me how I can tell the bulk insert that this identity column isn't for data from the file.

    Regards,

    Nico

  • There is no switch to utilize a column in BULK INSERT to not overwrite the column. Only KEEPIDENTYT which allows you to insert an Identity value from the file. DTS would be your best bet to import like you are suggesting.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

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

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