Node enabled pollers query

Query has NetObjectID = 1 as an example, simply replace with the node id necessary (or adjust as needed to show all data).

SELECT
	 n.Caption
	,p.PollerID
	,p.PollerType
	,p.Enabled
	,p.NetObjectID
FROM Orion.Pollers AS p
INNER JOIN Orion.Nodes AS n ON n.NodeID = p.NetObjectID AND p.NetObjectType = 'N' AND p.Enabled = 1
INNER JOIN Orion.DeviceStudio.PollerAssignments AS d ON d.NetObjectID = n.NodeID AND d.NetObjectType = 'N' AND d.Enabled = 1
WHERE p.NetObjectID = 1
UNION ALL
( SELECT
	 n.Caption
	,d.ID AS [PollerID]
	,dt.Name AS [PollerType]
	,d.Enabled
	,d.NetObjectID
FROM Orion.DeviceStudio.PollerAssignments AS d
INNER JOIN Orion.Nodes AS n ON d.NetObjectID = n.NodeID AND d.NetObjectType = 'N' AND d.Enabled = 1
INNER JOIN Orion.DeviceStudio.Pollers AS dp ON dp.PollerID = d.PollerID
INNER JOIN Orion.DeviceStudio.Technologies AS dt ON dt.TechnologyID = dp.TechnologyID
WHERE d.NetObjectID = 1 )

Anonymous