locked
Declaring one user variable inside the other RRS feed

  • Question

  • Hey Gurus,

    I have one string variable that defines the transaction type as "Revenue" or "Finance". I have another variable that am using to execute the appropriate stored procedure based on whether the transaction type is revenue or finance. I want to either use a script task for this or I want to be able to do this in my new variable. Can someone please help me with the appropriate code for either of that?

    Thanks in advance!

    Friday, June 14, 2013 9:42 PM

Answers

  • You can create a variable varSql with its expression as: @[user::varTranType]== "Revenue" ? "Exec procforrevenuetrantype" : (@[User::varTranType]=="Finance" ? "Exec procforfinancetrantype" : "NA") Now use a dummy script task and connect it to an execute sql task. This execute sql task will use the variable varSql to execute the appropriate procedure. Use precedence constraint editor to use the expression @[User::varSql]!="NA" to ensure that execute sql task executes when tran type value is either revenue or finance.

    Nitesh Rai- Please mark the post as answered if it answers your question

    • Proposed as answer by ArthurZ Sunday, June 16, 2013 3:27 PM
    • Marked as answer by Mike Yin Sunday, June 23, 2013 7:19 AM
    Saturday, June 15, 2013 2:20 PM