Skip to content

Conversation

@DavidWiseman
Copy link
Collaborator

Fix issue where incorrect information was returned for the master database due to DB_ID() returning a different value for the database_id than sys.databases. #1627

Fix issue where incorrect information was returned for the master database due to DB_ID() returning a different value for the database_id than sys.databases.
Copilot AI review requested due to automatic review settings November 14, 2025 15:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the master database query was returning incorrect information due to a mismatch between DB_ID() and the database_id values in sys.database_service_objectives. The fix changes the query to join with sys.databases and filter by database name instead of ID.

Key Changes:

  • Replaced direct DB_ID() filtering with a join to sys.databases and filtering by DB_NAME()
  • Added table aliases for improved readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DavidWiseman DavidWiseman merged commit cde2642 into trimble-oss:main Nov 15, 2025
@DavidWiseman DavidWiseman deleted the 1627_AzureDBServiceObjectivesFix branch November 15, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant