all groups > sql server notification services > november 2006 >
You're in the

sql server notification services

group:

Variable in SMTP Protocol


Variable in SMTP Protocol Kevin Eckart
11/21/2006 2:12:26 PM
sql server notification services:
I would like to include a variable in the Subject field of an email sent
from Notification Services. Is there a way to do this? What is the
limitation of the <SQLExpression></SQLExpression> tag in the Protocol? Is
this where I would grab my variable?

Below is the protocol portion of my ADF file. Any help would be greatly
appreciated.

Thanks,
Kevin E.

<Protocols>
<Protocol>
<ProtocolName>SMTP</ProtocolName>
<Fields>
<Field>
<FieldName>Subject</FieldName>
<SqlExpression>'HD Notification'</SqlExpression>
</Field>
<Field>
<FieldName>From</FieldName>
<SqlExpression>N'okreports@okind.com'</SqlExpression>
</Field>
<Field>
<FieldName>To</FieldName>
<SqlExpression>DeviceAddress</SqlExpression>
</Field>
<Field>
<FieldName>Priority</FieldName>
<SqlExpression>N'Normal'</SqlExpression>
</Field>
<Field>
<FieldName>BodyFormat</FieldName>
<SqlExpression>N'html'</SqlExpression>
</Field>
</Fields>
<ProtocolExecutionSettings></ProtocolExecutionSettings>
</Protocol>
</Protocols>

Re: Variable in SMTP Protocol Joe Webb
11/27/2006 12:00:00 AM
Hi Kevin -

I routinely do something like this in my emails.

<Field>
<FieldName>Subject</FieldName>
<SqlExpression>'ABC Motorworks Press Release - ' + CONVERT
(NVARCHAR(30), GETDATE(), 101)
</SqlExpression>
</Field>


Constants and functions are valid in the SqlExpression element.

HTH...
Joe


--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Tue, 21 Nov 2006 14:12:26 -0600, "Kevin Eckart"
[quoted text, click to view]
Re: Variable in SMTP Protocol Kevin Eckart
11/27/2006 4:15:31 PM
Joe, thanks for the reply. Is it possible to use part of the notification
alert in the subject. For instance, each notification i send out has a
ticket # that is a field in the alert as well as in the Email format file.
Can i use this ticketno (or any other field) in the subject?

Thanks,
kevin

[quoted text, click to view]

Re: Variable in SMTP Protocol Joe Webb
12/6/2006 5:17:18 AM
Sure. Just be aware that if you have digest delivery, you won't have
just one ticket#.



--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Mon, 27 Nov 2006 16:15:31 -0600, "Kevin Eckart"
[quoted text, click to view]
AddThis Social Bookmark Button