Are you using an ActiveX Script Task, or the new Script Task? I have used the
latter sucessfully to create the e-mail message:
1) Add a Script Task to the Control Flow.
2) On the second page, list the variables (comma Separated list) that the
script will use to build the string.
In the ReadWrite Variables section, list the varialbe that will hold the
completed script.
3) Click the Design Script button (lower right corner).
4) in the Script itself, enter the appropriate code that follows these
instructions
5) In the SendEMail Task, you can either set up the MessageSourceType as
"Variable" (can't remember if this is an option) then name the variable in
the MessageSource property
OR
5) In the SendEMail task, on the Expressions page, add a new expression for
MessageSource and drag from the Variables to the lower pane.
****************** SAMPLE SCRIPT **************
Dim strInputText as String
strInputText = CStr(Dts.Variables("MyInputVariable").Value
Dim strOutputText as String
strOutputText = "Hi, this is a sample message that says: " & strInputText
Dts.Variables("MyReadWriteVariable").Value = strOutputText
**************** END *******************
A good book on the subject is
A Rational Guide to Scripting SQL Server 2005 Integration Services
by Donald Farmer
ISBN 1-932577-21-1
Hope this helps!
--
Todd Chittenden
"doug" wrote:
Quote:
I have set up a package that runs a query, returns a row count into a global
variable, and then based on that value determines if an email should be sent.
An Active X script in the workflow of the email step is where this
determination is done.
Is it possible to add additional global variables to the query and then
include those values in the text of the email if one is sent? If so, how
would I do this?
Thanks in advance. |