how do you define/wire a precedence constraint condition between two tasks in an SSIS package

Posted on 2011-05-11
Last Modified: 2013-11-18
Expert: New to SSIS Integration Services Packages.
I have a Execute SQL Task and a Send Mail Task with a precedence constraint between them. I want to know how to create an constraint expression (scalar value?) from the Execute SQL Task query code listed below such that when the query results  sets Email = 1 the constraint  is satisfied and the Send Mail Task executes. Please show me how to create the Constraint Expression.

Part of the "Execute SQL Task"  query code:
SET Email = 1
WHERE 4 <= datediff(hh, startDate, getdate())
etc ...etc.....

Question by:tcmmaxt
    LVL 1

    Accepted Solution

    Assuming each record contains an email address, a constraint may not be be the best way to go- the following seems more appropriate:

    1) Update the records as shown in your SQL

    2) Loop back through those records and send the email for each record where Email = 1.

    I can expand on this if the concept sounds right. Use of constraints are more appropriate for scalar results (e.g. if xxx is in table yyy).

    Author Comment

    ISO30: thanks.  I am new to this SSIS stuff. If you can somhow show me how to loop thru records and send out email for those records flagged Email = 1 that would be great since I am not sure  how to do this. Also I guess I would need some kind of  job set-up to run the package say each morning? Also the email messages in body are not status and will need to to reflect data relative to that record. Not sure how to do this?

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Preface In the first article: A Better Website Login System ( I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
    I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now