Update table in dataflow task

  • Hi friends,

    I am importing data from access database to my sql server DB. I want to check whether the record already exists or not. If exists, I want to do update the existing record or insert new record.

    I can use lookup transform and able to insert if not exists.

    How can I perform update operation if record already exists (Lookup match path).

    thanks

  • You can use an OLE DB Command Task to update the values..

    Your Parametrized SQL should look like this

    Update TABLENAME

    SET Column1 = ?

    WHERE Column2 = ?

    Check this Example : http://www.sqlis.com/post/OLE-DB-Command-Transformation.aspx

    If you need more help on this.let me know

  • Another option is to use a temporary table to store your update records.

    Then, after the data flow task, you can issue one update statement against the destination table using the temporary table.

    The advantage of this approach is that it will issue only one update statement, while the OLE DB command will issue an update statement for each row. If you are moving a lot of data, the performance gain will be noticable.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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