Link to home
Start Free TrialLog in
Avatar of JRuiter
JRuiter

asked on

SQL Integraton Services 2005 SMTP email - how do I put a variable in the subject line

I have a 2005 SSIS package that sends email based upon the value of a database field.  The package runs to completion.  I would like to construct a Subject field based upon some variables.

For Example:

Subject:  @CustomerID, @OrderID

where @CustomerID and @OrderID are variables.

I don't see a way to construct a subject line.  Is it possible?

Thanks
Avatar of pateljitu
pateljitu
Flag of Canada image

Please try code as provided:

DECLARE @emailSubject varchar(250)
SET @emailSubject = '' + convert(varchar(10), @CustomerID) +',  '+  convert(varchar(10), @OrderID) +''
Avatar of JRuiter
JRuiter

ASKER

Where do I put that code? Do I create an expression?

I don't see anywhere in the Subject line that it will accept input from SQL code or a variable, unlike the message body - I can use an expression there.
would you be able to provide sample or reference of your code.
ASKER CERTIFIED SOLUTION
Avatar of jawaharroy
jawaharroy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial