1 Reply Latest reply on Jun 23, 2016 12:09 PM by njoylif

    Alert Email Prints Out SQL Statement

    donpepe

      Hi,

       

      I have been trying to get an email to print out the following SQL Statement:

       

      ${SQL:SELECT TOP 25 Message_UNICODE + CHAR(13) + CHAR(10) as 'data()' FROM [dbo].[SysLog] WHERE NodeID=${N=SwisEntity;M=Node.NodeID} FOR XML PATH ('')}

       

      This statement should be the last 25 syslog messages from a certain Node ID.

       

      Instead the output in the email is:

       

      ${SQL: SELECT TOP 25 NodeID, Message_UNICODE + CHAR(13) + CHAR(10) as 'data()' FROM [dbo].[SysLog] WHERE NodeID=456 FOR XML PATH ('')}

       

      If I copy and paste that into the email alert it then works. I know you can use variables in SQL statements. Anyone have an idea as to why this isn't work?