How to Update table using flat file as a source?

  • Hi All ,

    I am looking for an answer to my update query .

    I have a .csv file as a source . I have already populated my destination table . Now , based on some conditions i want to update the dest. table.

    For ex. I have a Empcode column as a pri. key column. I want to check these values with the values coming from flat file source . If the value matches then only update the other two columns of the table else do nothing .

    I tried this with lookup and conditional split ,but not working . Am i correct or missing something or is there another way of doing this like using Sql task .

    Any help would be much appreciated .

    Thanks

    🙂

  • you will have to use a lookup to find the matching entries and then map the Lookup Match Output to OLE DB Command transformation Task to update values passing the update columns as parameters like

    update TableName

    SET columName = ?, Colum2 = ?

    WHERE LookUpColumn = ?

    and in the next tab, map these parameters correctly in same order

  • Thanks

    But the updated values should also come from flat file .

    Means if the primary column matches then update 2nd column of the table with values from flat file .

    Is it possible here ?

    How to get those columns in Lookup?

  • In look up you have Columns Tab where you map the Lookup Columns and also select the desired output columns where you can select the columns to be updated..

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

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