Vendredi, Novembre 5, 2021

Configuration des DB

Récupération de configuration des données en SWQL

SELECT 
    sql.Node.Caption, 
    sql.InstanceName, 
    sql.ProductVersion, 
    sql.ProductLevel, 
    sql.Edition, 
    sql.Name,type.value,
    (CASE 
        WHEN type.Value = 'Static' THEN port.Value 
        ELSE 1433 
    END) as PortNumber
FROM 
    Orion.APM.SqlServerApplication as sql
LEFT JOIN 
    Orion.APM.ApplicationSettings as port ON sql.ApplicationID = port.ApplicationID
LEFT JOIN 
    Orion.APM.ApplicationSettings as type ON sql.ApplicationID = type.ApplicationID
WHERE 
    port.Key = 'PortNumber'
    AND type.Key = 'PortType'
ORDER BY
    sql.Node.Caption, 
    sql.InstanceName