Search code examples
sql-serverssisforeach-loop-container

SSIS Task to insert or update a row


Which kind of SSIS task should I use when I got some rows from a data source, then insert new row in destination or update the row in destination in case it exists.

I was thinking to use a SQL task for getting rows in a result set then use a for loop container. But I don't know how to continue further on.


Solution

  • You can use Lookup task:

    • on match you execute an UPDATE statement via OLE DB command
    • on error you add row in destination via OLE DB destination task