Running a DFT Based on a condition in SSIS

205 views Asked by At

I've a package where I need to retrieve data from a mysql table and insert it into sql server table. I've a situation where in old data often gets modified and the client wants to dump all data which is too large and time consuming...So I've come up with a proposal that we'd load only yesterday's data on week days and do complete dump on weekend...Is there a possibility of Enable/Disabling a DFT Based on an expression? I've Tried using Expressions->Disable based on DATEPART(WeekDAY,GETDATE()) but it runs for a complete load irrespective of expression's value

Regards, Vijay

2

There are 2 answers

0
Jim Horn On BEST ANSWER

Create a SQL Task or Script Task that does your expression, and set the result to a variable. Then create your data flow task. Then connect the two with an arrow (aka precedence constraint)

Then right-click:Edit on the arror and choose Edit, and in the Precedence Constraint Editor choose EvaluationOperation: Expression Value: @@YourVariable= {an expression, such as @iRowsUpdated==True}

0
Daryl Wenman-Bateson On

You should put the condition as a where clause against your select statement in your source query. You will need to change access mode from table to SQL Statement first