This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SWQL and Declare Variables be used

Can declare variables be used in SWQL. 

Snippit example Example:

DECLARE @BSvar VARCHAR(MAX)
SET @BSvar = 'CLAS'
SELECT Count
(N.Caption) As Value
,N.IOSVersion AS OS
FROM Orion.Nodes N
WHERE (
N.MachineType LIKE '%RED%'
AND N.IOSVersion LIKE '%Red%5.%'
AND N.CustomProperties.business_system = '@BSvar'
)
UNION
(SELECT Count
(N.Caption) As Value
,N.IOSVersion AS OS
FROM Orion.Nodes N
WHERE (
N.MachineType LIKE '%RED%'
AND N.IOSVersion LIKE '%Red%6.%'
AND N.CustomProperties.business_system = '@BSvar'
)
)
 
End snipped