I'm having a problem with Solarwinds Report writer not running my query correctly. When I run the following query inside of Report Writer, it populates my Message field with a Time as opposed to my OIDValue. When I run this same query inside of SQL Mgmt Studio express, it correctly runs.
I need help getting this report to correctly run inside of Report Writer, please assist:
SET NOCOUNT ON
Declare @OIDValue varchar(8000)
Select DISTINCT @OIDValue = ISNULL(@OIDValue + ' ','') + OIDValue from trapvarbinds,traps where trapvarbinds.trapid = traps.trapid
set ROWCOUNT 25
SELECT DISTINCT
Traps.DateTime AS Date_Time,
Traps.Hostname AS HostName,
@OIDValue AS Message,
Traps.Tag AS SNMP_Tag,
Traps.TrapID AS Trap_ID
FROM
Traps, Trapvarbinds
WHERE
(
(Traps.Tag = 'Alert')
)
AND
(
(Traps.TrapID=TrapVarbinds.TrapID)
)
ORDER BY DateTime DESC, Message DESC
set rowcount 0