Submit a ticketCall us

Solarwinds & Cisco Live! Barcelona
Join us from the 29th of January to the 2nd of February at Cisco Live 2018 in Barcelona, where we will continue to show how monitoring the network with SolarWinds will keep you ahead of the game. At our booth (WEP 1A), we will demonstrate how SolarWinds network solutions can help. As a bonus, we are also hosting a pre-event webinar - Blame the Network, Hybrid IT Edition with our SolarWinds Head Geek™, Patrick Hubbard on January 24th - GMT (UTC+0): 10:00 a.m. to 11:00 a.m. There's still time to RSVP.

Home > Success Center > Server & Application Monitor (SAM) > Pull individual numeric values from a multi-value script

Pull individual numeric values from a multi-value script


You want to pull individual numeric values from a multi-value script.


All SAM versions


The following function works for numeric data:

CREATE FUNCTION [dbo].[apm_Custom_GetMultiValueCurrentnumericdata] (
       @ComponentID int,
       @RowNumber int
 RETURNS nvarchar(max)
       DECLARE @result nvarchar(max)
       SELECT @result = Temp.NumericData FROM
             SELECT RANK() OVER (ORDER BY DynEvDef.ID) AS Row, DynEvData.NumericData
             FROM dbo.APM_DynamicEvidence_DetailData AS DynEvData
             INNER JOIN dbo.APM_CurrentComponentStatus AS CCS
                 ON CCS.ComponentStatusID = DynEvData.ComponentStatusID
             INNER JOIN dbo.APM_DynamicEvidenceColumnSchema AS DynEvDef
                 ON DynEvDef.ID = DynEvData.ColumnSchemaID
             WHERE DynEvDef.[Type] = 1 AND CCS.ComponentID = @ComponentID
       ) Temp
       WHERE Temp.Row = @RowNumber
       RETURN @result

At this point, you can use the following inline SQL macro in the Alert Manager to get the first value

${SQL:select dbo.apm_Custom_GetMultiValueCurrentnumericdata(${ComponentId}, 1)}



Last modified