Fix duplicate keys in perf counters sqlserver query (#3175)

This commit is contained in:
Mark Wilkinson - m82labs 2017-09-14 18:04:13 -04:00 committed by Daniel Nelson
parent 5fd6b64d10
commit 53cb9ffb31
1 changed files with 2 additions and 2 deletions

View File

@ -1022,7 +1022,7 @@ CREATE TABLE #PCounters
Primary Key(object_name, counter_name, instance_name)
);
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.instance_name) instance_name
, spi.cntr_value
@ -1044,7 +1044,7 @@ CREATE TABLE #CCounters
Primary Key(object_name, counter_name, instance_name)
);
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.instance_name) instance_name
, spi.cntr_value