Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

Conversion failed when converting the varchar value

$
0
0

Working on an alert for interface discards. This is the swql generated by the alert:

SELECT E0.[Uri], E0.[DisplayName]

FROM Orion.NPM.Interfaces AS E0

WHERE ( ( ( E0.[Node].[CustomProperties].[Alerts] = 'T' ) AND ( E0.[CustomProperties].[Alerts] = 'T' ) ) AND ( ( E0.[InErrorsDiscardsThreshold].[IsLevel1State] = 'True' ) AND ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 'True' ) AND ( E0.[OutErrorsDiscardsThreshold].[IsLevel1State] = 'True' ) AND ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 'True' ) ) )

 

When I paste that into the SWQL studio I get the error "Conversaion failed when converting the varchar value 'false' to data type int"


If I take away the Where statement the query returns and the values show up as False

 

Also I changed the alert to be OR because I realized it wouldn't work with an AND at all. But wanting to know changing the query to

SELECT E0.[Uri], E0.[DisplayName]

FROM Orion.NPM.Interfaces AS E0

WHERE ( ( ( E0.[Node].[CustomProperties].[Alerts] = 'T' ) AND ( E0.[CustomProperties].[Alerts] = 'T' ) ) AND ( ( E0.[InErrorsDiscardsThreshold].[IsLevel1State] = 1 ) OR ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 1 ) OR ( E0.[OutErrorsDiscardsThreshold].[IsLevel1State] = 1 ) OR ( E0.[InErrorsDiscardsThreshold].[IsLevel2State] = 1 ) ) )

 

makes it work so it looks like 1 is true and 0 is false. Is this correct?


Viewing all articles
Browse latest Browse all 2677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>