Script Task - SSIS

  • Hi,

    I dont wish to use a data flow task just to use the conditional split...

    Instead I want to form a script in the control flow which will disable/enable tasks accordinging to what the variable is set when an sql task is executed and populates the resultset.

     

    Can anyone help?...and guide me through forming a script which will enable me to do this.

     

     

  • You don't need a script task, nor do you need to enable or disable tasks. In fact, I don't think you can do that at run time. Use an expression on the precedence constraints.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • I'm guessing the reason that you want to use a script task rather than a conditional split is that you don't know how to do the check you need outside of a script task?  A simple way to accomplish your task would be to use both the split and the script task.  First you can perform your check in the script task, and then you will set a boolean value that will be added as an output from the script task.  Once you do that, it is simply a matter of using the conditional split to check the value of the boolean you passed from the check in the script. 

    Hope this helps,

    jim

  • Crispin,

    I was having the same issue and your response of using expressions on the precedence constraints proved to be very helpful for me.

    Thanks,

    rusty

  • I used a combination of scripting and precedence constraints.

    In my case I had to maintain a boolean variable with if a particular run balances, which I did in the script maintenance during the dataflow.

    Then I had a precedence constraint either continuing with the rest of the flow if the variable was set to true, or going into an alert email/abort kind of scenario if the variable was false.

    All depends on what you want to do with your run

    ~PD

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

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