Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add database name in azure Managed instance. query version 2 is worki… #6787

Closed
wants to merge 1 commit into from

Conversation

selvakumar895
Copy link

…ng Vm sqlserver instacnes but not in Manged instances, it returned Guid.

INSERT INTO @PCounters
SELECT DISTINCT
RTrim(spi.object_name) object_name,
RTrim(spi.counter_name) counter_name,
RTrim(isnull(d.name,spi.instance_name) instance_name,
CAST(spi.cntr_value AS BIGINT) AS cntr_value,
spi.cntr_type
FROM sys.dm_os_performance_counters AS spi
LEFT OUTER JOIN sys.databases AS d ON spi.instance_name = d.physical_database_name

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

…ng Vm sqlserver instacnes but not in Manged instances, it returned Guid.

INSERT	INTO @PCounters
SELECT	DISTINCT
		RTrim(spi.object_name) object_name,
		RTrim(spi.counter_name) counter_name,
		RTrim(isnull(d.name,spi.instance_name) instance_name,
		CAST(spi.cntr_value AS BIGINT) AS cntr_value,
		spi.cntr_type
FROM	sys.dm_os_performance_counters AS spi 
LEFT OUTER JOIN sys.databases AS d ON spi.instance_name = d.physical_database_name
@danielnelson danielnelson added area/sqlserver fix pr to fix corresponding bug labels Dec 11, 2019
@danielnelson
Copy link
Contributor

@denzilribeiro Can you review?

@denzilribeiro
Copy link
Contributor

There are some other caveats into it too for master physical_db_name is same as the database name for a Azure SQL DB ( single DB), can result in dup rows, will take a closer look at it and fix soon. This is not only a MI issue but also a single DB issue

@denzilribeiro
Copy link
Contributor

Should work now?
#6869

@danielnelson danielnelson added this to the 1.14.0 milestone Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sqlserver fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants