I am trying to Configure Database Mail for a Historian Event, I'm using historian 10.0.
I am running Microsoft SQL server 2008 on windows server 2003 R2.
I setup the database mail using WW Tech Note 551, however point 8 - " Select the Private Profiles tab and change the user name to NT Autority\SYSTEM."
Was differnet in that I only had the following user name options
- ##MS_PolicyEventProcessingLogin##
- ##MS_PolicyTsqlExecutionLogin##
- MS_DataCollectorInternalUser
When I run a Query with the script below in Microsoft SQL Server Management Studio, the email works correctly, However when I copy the script to action Generic SQL in the historian Event tag it does not work.
The Generic SQL script is:
Set Quoted_Identifier OFF
declare @AnalogValue float
declare @BodyTxt varchar (1000)
set @AnalogValue = (select Value from INSQL.Runtime.dbo.AnalogLive where TagName = 'Viaflo_Tank08_level_LCD-05') set @BodyTxt = Current level = '+ cast(@AnalogValue as varchar)+' KG.
EXEC msdb.dbo.sp_send_dbmail @profile_name="InSQLMail",
@recipients="name@email.com",
@subject='Tank 8 High level alarm',
@body=@BodyTxt".
I am running Microsoft SQL server 2008 on windows server 2003 R2.
I setup the database mail using WW Tech Note 551, however point 8 - " Select the Private Profiles tab and change the user name to NT Autority\SYSTEM."
Was differnet in that I only had the following user name options
- ##MS_PolicyEventProcessingLogin##
- ##MS_PolicyTsqlExecutionLogin##
- MS_DataCollectorInternalUser
When I run a Query with the script below in Microsoft SQL Server Management Studio, the email works correctly, However when I copy the script to action Generic SQL in the historian Event tag it does not work.
The Generic SQL script is:
Set Quoted_Identifier OFF
declare @AnalogValue float
declare @BodyTxt varchar (1000)
set @AnalogValue = (select Value from INSQL.Runtime.dbo.AnalogLive where TagName = 'Viaflo_Tank08_level_LCD-05') set @BodyTxt = Current level = '+ cast(@AnalogValue as varchar)+' KG.
EXEC msdb.dbo.sp_send_dbmail @profile_name="InSQLMail",
@recipients="name@email.com",
@subject='Tank 8 High level alarm',
@body=@BodyTxt".