|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, April 30, 2013 7:48 AM
Points: 58,
Visits: 170
|
|
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
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 5:52 AM
Points: 4,239,
Visits: 9,484
|
|
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.
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, April 30, 2013 7:48 AM
Points: 58,
Visits: 170
|
|
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?
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 5:52 AM
Points: 4,239,
Visits: 9,484
|
|
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.
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, April 30, 2013 7:48 AM
Points: 58,
Visits: 170
|
|
|
|
|