Article ID: 906547 - Last Review: March 11, 2006 - Revision: 2.1 How to create a dynamic subject or message for the Send Mail task in SQL Server 2005 Integration Services
INTRODUCTIONYou can create a Microsoft SQL Server 2005 Integration Services
(SSIS) package by using SQL Server Business Intelligence Development Studio. When you create this package,
you can create an expression for a property of the SSIS package to
update or to populate the property at runtime. For example, if the SSIS package
contains a Send Mail task, you can create an expression for
the Subject property and for the MessageSource
property. You can use the Subject property expression to dynamically update the subject of an e-mail message. You can use the MessageSource property expression to dynamically update variables in the e-mail message, such as variables that are populated by a Row Count transformation. This article discusses how to create a dynamic subject or message for the Send Mail task. MORE INFORMATIONThe following is a sample property expression
for the Subject property in a Send Mail task.
To specify that an e-mail message be sent only if the row count is smaller than a certain value, modify the control flow by using precedence constraints. To do this, follow these steps:
Additionally, you can use the Send Mail task as part of an error handler. For example, you may want to send an e-mail message to administrators when an SSIS package does not execute. To do this, create an OnError event handler for the package, and then add a Send Mail task to the event handler. Create a subject property expression that captures the time that the package is executed, the start time of the container, or the start time of the event handler from the relevant system variables. For example, create an expression that is similar to the following.
REFERENCESFor more information, see the following topics in SQL Server 2005 Books Online:
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top