How to use use if..else in Data Flow based on user variable values in SSIS
I guess there are enough pointers here for Agent 007 to resolve the issue. I would like to add a few general comments.
Enabling/disabling the tasks dynamically is not a good practice. A better way to disable a task is to use an expression within a precedence constraint. One such reference: http://www.sqlis.com/sqlis/post/Disabling-tasks-Through-Expressions.aspx
As suggested convert each STD (Source-Transform-Destination) into its own DFT. Even better use parent-child pattern. This would help in testing future additions of more DFTs.
Agent007
public class Me : Lazy<Person> { public void DoWork() { throw new NotImplementedException(); } }
Updated on June 14, 2022Comments
-
Agent007 almost 2 years
I have a fairly straightforward SSIS package with a number of
Data Flow
tasks each with data-flows for multiple tables like shown below:I want to be able to execute each of these data-flows based on some user-defined variable values that I manipulate using a
Script Task
in control-flow. Something like, if a variable (say BESTELLDRUCK) value istrue
, then I want to execute the data-flow for this table (source-conversion-destination tasks), else I want to skip this table and proceed to another table (e.g. AKT_FEHLER) in same data-flow task.How can I do this? Thanks in advance.
-
Peter PitLock about 8 yearsOnce you've split each into its own DFT, is it possible to execute a specific DFT via SQL Command? on the IDE it is easy, just right click the DFT and execute
-
Anoop Verma about 8 yearsIf you want to run the DFT via a SQL command, I would suggest that you put each DFT in a child package of its own.