locked
change control flow based on variable RRS feed

  • Question

  • I have 2 connected data flow tasks and then a connected send mail task. I would like to always execute the first data flow task, and then based on a variable (named "flow") either execute the second data flow task or skip it and execute the send mail task. If the second data flow task is executed it should then execute the send mail task. I created a boolean variable with value 0 or 1. So if the variable is 0 shoulsd execute in this order: data flow task 1, data flow task 2, send mail task. If the variable is 1 should execute in this order: data flow task 1, send mail task. I have data flow task 1 connected to data flow task 2 with an expression and a constraint, on success and the expression is @[user::flow] == 0 I also have data flow task 1 connected to the send mail task with an expression and constraint, on succes and the expression is @[user::flow] == 1 I also have data flow task 2 connected to the send mail task on success. The problem is the send mail task never gets executed regardless of the value of the flow variable.


    • Edited by SSISJoostMVP Thursday, February 7, 2013 7:57 PM removed all bold
    Thursday, February 7, 2013 7:23 PM

Answers

  • It sounds like you want to execute the same Send Mail task. If so then set the Multiple Contraints property to Logical OR.

    Russel Loski, MCT, MCSA SQL Server 2012, 2008, MCITP Business Intelligence Developer and Database Developer 2008 Twitter: @sqlmovers; blog: www.sqlmovers.com

    • Proposed as answer by SSISJoostMVP Thursday, February 7, 2013 7:58 PM
    • Marked as answer by JISban Thursday, February 7, 2013 8:29 PM
    Thursday, February 7, 2013 7:55 PM
  • Have you used the OR option?

    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter


    • Edited by SSISJoostMVP Thursday, February 7, 2013 8:03 PM
    • Marked as answer by JISban Thursday, February 7, 2013 8:29 PM
    Thursday, February 7, 2013 7:56 PM

All replies

  • It sounds like you want to execute the same Send Mail task. If so then set the Multiple Contraints property to Logical OR.

    Russel Loski, MCT, MCSA SQL Server 2012, 2008, MCITP Business Intelligence Developer and Database Developer 2008 Twitter: @sqlmovers; blog: www.sqlmovers.com

    • Proposed as answer by SSISJoostMVP Thursday, February 7, 2013 7:58 PM
    • Marked as answer by JISban Thursday, February 7, 2013 8:29 PM
    Thursday, February 7, 2013 7:55 PM
  • Have you used the OR option?

    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter


    • Edited by SSISJoostMVP Thursday, February 7, 2013 8:03 PM
    • Marked as answer by JISban Thursday, February 7, 2013 8:29 PM
    Thursday, February 7, 2013 7:56 PM