Skip to content

Commit a858d9b

Browse files
author
Taryn Pratt
committed
Fixing issue with not converting to money
1 parent c1bdafb commit a858d9b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Opserver.Core/Data/SQL/SQLInstance.PerfCounters.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ And spi.object_name Not Like 'SQL Server 2016 XTP%'
6969
cc.counter_name CounterName,
7070
cc.instance_name InstanceName,
7171
cc.cntr_value CurrentValue,
72-
(Case cc.cntr_type
72+
CAST((Case cc.cntr_type
7373
When 65792 Then cc.cntr_value -- Count
74-
When 537003264 Then IsNull(Cast(cc.cntr_value as Money) / NullIf(cbc.cntr_value, 0), 0) -- Ratio
74+
When 537003264 Then IsNull(cc.cntr_value * 1.0 / NullIf(cbc.cntr_value, 0), 0) -- Ratio
7575
When 272696576 Then cc.cntr_value - pc.cntr_value -- Per Second
76-
When 1073874176 Then IsNull(Cast(cc.cntr_value - pc.cntr_value as Money) / NullIf(cbc.cntr_value - pbc.cntr_value, 0), 0) -- Avg
76+
When 1073874176 Then IsNull((cc.cntr_value - pc.cntr_value) * 1.0 / NullIf(cbc.cntr_value - pbc.cntr_value, 0), 0) -- Avg
7777
When 1073939712 Then cc.cntr_value - pc.cntr_value -- Base
7878
Else cc.cntr_value
79-
End) CalculatedValue,
79+
End) as decimal(25,2)) CalculatedValue,
8080
cc.cntr_type Type
8181
From @CCounters cc
8282
Left Join @CCounters cbc

0 commit comments

Comments
 (0)