Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use Script component to execute DELETE statement for each row in input path but that might be very slow depending on number of rows to be deleted.</p> <p>You can:</p> <ol> <li>Store PKs of records that should be deleted to a database table (for instance: TBL_TO_DEL)</li> <li>Add Execute SQL Task with SQL query to delete records by joining TBL_TO_DEL with table that You want to delete records from</li> <li>Put <a href="http://msdn.microsoft.com/en-us/library/ms141261.aspx" rel="nofollow noreferrer">precedence constraint</a> on path between your data flow and Execute SQL task (constraint based on your variable)</li> </ol> <p>This solution is much faster than deleting row by row. </p> <p>If for some reason You can't create new table, check my answer on <a href="https://stackoverflow.com/questions/7571899/ssis-pass-datasource-between-control-flow-tasks">SSIS Pass Datasource Between Control Flow Tasks</a> to see other ways to pass data to next data flow where You can use OleDb source and OleDb command. Whichever way You choose, key is in constraint that will or will not execute following task (Execute SQL task or data flow) depending on value in variable. </p> <p>Note that Execute SQL task will not validate query and as such will fail at runtime if constraint is satisfied and table doesn't exist. If You use another Data Flow instead of Execute SQL Task, set <a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.dtscontainer.delayvalidation.aspx" rel="nofollow noreferrer">DelayedValidation</a> property to true. It means that task will be validated at the moment prior to executing particular task, not anytime earlier.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload