How to Delete rows from Destination table

  • I have an ETL that updates a destination table from a source table.

    The ETL determines if the row is new or changed via a lookup and conditional split.

    What is the best way to delete rows from my destination table, that do not exist in the source table?

    Would an Execute Sql Task be the best way to do this?

    Thanks

  • Where is your source data coming from? A DELETE query (or series of queries, if lots of rows are to be deleted) would be faster.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • My source is a Sql Server table. The only way I can think of deleting rows from my destination sql server table is to have an 'Execute Sql Task' and execute a delete comman for rows that don't exist in my source table.

    Is this the best way to do this?

  • Yes. If there are hundreds of thousands of records to be deleted, I would recommend that you do the delete in batches to avoid huge transactions grinding your system to a halt - but that's still just an Execute SQL task.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thank you so much.

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

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