2 Replies Latest reply on Jan 13, 2015 2:36 AM by pradeepkumar.v

    Convert SQL query to SWQL




      I need to convert below SQL query to SWQL. I want to count the number of components in the applications which are down.


      SELECT  TOP 10000 Nodes.NodeID AS NodeID,
      Nodes.Caption AS NodeName,
      APM_AlertsAndReportsData.ApplicationName AS Application_Name,
      APM_AlertsAndReportsData.ApplicationStatus AS Application_Status,
      COUNT(APM_AlertsAndReportsData.ComponentName) AS COUNT_of_Component_Name,
      APM_AlertsAndReportsData.ComponentStatus AS Component_Status

      Nodes INNER JOIN APM_AlertsAndReportsData ON (Nodes.NodeID = APM_AlertsAndReportsData.NodeId)


      GROUP BY Nodes.NodeID, Nodes.Caption, APM_AlertsAndReportsData.ApplicationName, APM_AlertsAndReportsData.ApplicationStatus, APM_AlertsAndReportsData.ComponentStatus

        • Re: Convert SQL query to SWQL

          Well - could just give you the query - or...teach you how to go figure it out. 

          First thing - go download the SolarWinds Orion SDK.    It has SWQL Studio with it.


          Make a connection to your core server (easiest way) -- NOT the SQL server!   Once you have a working SQL query, then paste it in there, and you can do table look ups to determine the names you need on the tables.   It is helpful if you alias your table names in the "from" line, so it is easier to deal with.


          So -



          from Orion.Nodes N