updating sql table from text file

  • Hi,can anyone help me?

    I need to update a SQL table reading a text file. I'm using Streamreader in vb.net , I split the string in it`s components but I don't know how to pass this splitted string as parameters to match with the columns of the table.

    Must be an update, in other case i've used BULK INSERT to insert files but in this case I can't

    example:

    txtfile(or CSV)

    "25786",""john","Myers",Glucose","130","Checked"

    Table

    Id       Name     LastName     determination   Value    Notes

    Thank you in advance!!!

  • Bulk Insert it into a different table (typically called a "staging" table).

    Once the data is in the staging table, run an UPDATE joining the 2 tables on the unique key column(s).

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

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