Send email based on the return value

  • Hi,

    Please help with on how to send email using the send email task based on the decision making.

    If true is returned from the sql query or from stored procedure,email needs to be sent else not

    Thanks

  • There are a number of ways to accomplish this. Here's one way. You'll need to do 2 things, both of which there are plenty of examples of how to do on this site and other.

    1) Store the value returned by your SQL query/stored procedure in a package variable. The easiest way to do this is to use the Result Set of an Execute SQL Task.

    2) After connecting your Execute SQL Task to a Send Mail Task, click on the green arrow between the two to open the Precedence Constraint Editor. Change the Evaluation Operation to "Expression and Constraint." Leave the Value set to "Success". In the Expression section, enter an expression to evaluate your variable. Something like '@MyVariable == True".

Viewing 2 posts - 1 through 1 (of 1 total)

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