This project is read-only.
1
Vote

Newest Version

description

Getting this error when selecting from view v_EvaluationErrorHistory_LastEvaluation: Msg 536, Level 16, State 4, Line 1
Invalid length parameter passed to the RIGHT function.

comments

js_0505 wrote Feb 18, 2016 at 1:01 AM

Error occurs on the union:
SELECT PolicyHistoryID
, EvaluatedServer
, EvaluationDateTime
, EvaluatedPolicy
, RIGHT(EvaluatedObject, CHARINDEX('\', REVERSE(EvaluatedObject)) - 1)  
, ExceptionMessage
, policy_id
, CategoryName COLLATE DATABASE_DEFAULT
, MonthYear
, PolicyResult
FROM policy.v_PolicyHistory_LastEvaluation
WHERE PolicyResult = 'ERROR'

js_0505 wrote Feb 18, 2016 at 1:02 AM

SELECT PolicyHistoryID
    , EvaluatedServer
    , EvaluationDateTime
    , EvaluatedPolicy
    , RIGHT(EvaluatedObject, CHARINDEX('\', REVERSE(EvaluatedObject)) - 1)  
    , ExceptionMessage
    , policy_id
    , CategoryName COLLATE DATABASE_DEFAULT
    , MonthYear
    , PolicyResult
FROM policy.v_PolicyHistory_LastEvaluation
WHERE PolicyResult = 'ERROR'

js_0505 wrote Feb 18, 2016 at 1:04 AM

Evaluated object = No Targets Found however policy.EvaluationErrorHistory is fine.

js_0505 wrote Feb 18, 2016 at 12:48 PM

I wish I could delete this thread. Figured it out as it was a result of no targets being found from a historical run.