Fix duplicate keys in perf counters sqlserver query (#3175)
(cherry picked from commit 1c5ebd4be3
)
This commit is contained in:
parent
8d4fbe29e7
commit
558ab0c730
|
@ -1022,7 +1022,7 @@ CREATE TABLE #PCounters
|
||||||
Primary Key(object_name, counter_name, instance_name)
|
Primary Key(object_name, counter_name, instance_name)
|
||||||
);
|
);
|
||||||
INSERT #PCounters
|
INSERT #PCounters
|
||||||
SELECT RTrim(spi.object_name) object_name
|
SELECT DISTINCT RTrim(spi.object_name) object_name
|
||||||
, RTrim(spi.counter_name) counter_name
|
, RTrim(spi.counter_name) counter_name
|
||||||
, RTrim(spi.instance_name) instance_name
|
, RTrim(spi.instance_name) instance_name
|
||||||
, spi.cntr_value
|
, spi.cntr_value
|
||||||
|
@ -1044,7 +1044,7 @@ CREATE TABLE #CCounters
|
||||||
Primary Key(object_name, counter_name, instance_name)
|
Primary Key(object_name, counter_name, instance_name)
|
||||||
);
|
);
|
||||||
INSERT #CCounters
|
INSERT #CCounters
|
||||||
SELECT RTrim(spi.object_name) object_name
|
SELECT DISTINCT RTrim(spi.object_name) object_name
|
||||||
, RTrim(spi.counter_name) counter_name
|
, RTrim(spi.counter_name) counter_name
|
||||||
, RTrim(spi.instance_name) instance_name
|
, RTrim(spi.instance_name) instance_name
|
||||||
, spi.cntr_value
|
, spi.cntr_value
|
||||||
|
|
Loading…
Reference in New Issue