Skip to content

Commit

Permalink
CollectionDates Alert fix
Browse files Browse the repository at this point in the history
Fix issue if use critical status is set and no threshold is specified.  In this case, the critical status threshold (daily check threshold) should be used rather than the alert threshold.  This will fix the
Cannot insert the value NULL into column 'Threshold' error.
Added ISNULL check just in case.
#1240
  • Loading branch information
DavidWiseman committed Feb 22, 2025
1 parent 7bb8521 commit a7ee3d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DBADashDB/Alert/Procedures/CollectionDatesAlert_Upd.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SELECT I.InstanceID,
R.Priority,
R.AlertKey,
CDS.Reference,
CASE WHEN Calc.UseCriticalStatus=1 AND CDS.CriticalThreshold<R.Threshold THEN CDS.CriticalThreshold ELSE R.Threshold END AS Threshold,
ISNULL(CASE WHEN Calc.UseCriticalStatus=1 AND (CDS.CriticalThreshold<R.Threshold OR R.Threshold IS NULL) THEN CDS.CriticalThreshold ELSE R.Threshold END,0) AS Threshold,
R.RuleID,
CDS.SnapshotAge
FROM Alert.Rules R
Expand Down

0 comments on commit a7ee3d7

Please sign in to comment.