Which Azure SQL Service Handles Cross-Database Queries with Least Effort?

Answer Correct answer: D — Use Azure SQL Managed Instance, which supports native cross-database T-SQL queries without Elastic Query setup, minimizing development effort and latency.

You have an Azure subscription. You plan to deploy an app that will store data across multiple databases. You need to recommend a storage solution for the app. The solution must meet the following requirements: • Ensure that queries can be executed simultaneously across all the databases. • Minimize development effort. • Minimize query latency. What should you include in the recommendation?

  1. SQL Server on Azure Virtual Machines
  2. Azure SQL Edge
  3. Azure SQL Database
  4. Azure SQL Managed Instance Correct Answer

Community Insight

The question tests cross-database query support in managed Azure SQL options; the trap is assuming Azure SQL Database natively supports cross-database T-SQL without Elastic Query setup.

Azure SQL Managed Instance is the recommended relational store when an app needs to query data across multiple databases because it supports native cross-database T-SQL queries. This page explains why it beats Azure SQL Database Elastic Query on development effort and latency.

Choosing Azure SQL Database because it is the default PaaS choice, while overlooking that cross-database queries require Elastic Query external data sources and external tables, which adds development work.

Community Discussion (1 comments)

gpais 👍 1 Selected: D
D (Azure SQL Managed Instance) • Zero-Code Cross-Queries: The counter-argument from many data architects is that setting up Elastic Query requires manual development effort (creating database master keys, database-scoped credentials, external data sources, and defining external tables for every schema you want to read). • Native T-SQL: Azure SQL Managed Instance handles cross-database queries natively using standard three-part naming (SELECT * FROM Db2.dbo.Table) out of the box with zero setup code. https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-sql-managed-instance#performance-efficiency

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Azure SQL Managed Instance runs multiple user databases on the same managed instance and supports cross-database queries with native T-SQL, so a query can reference tables in several databases without building a sharding or Elastic Query layer. That directly minimizes development effort because developers do not need to create master keys, scoped credentials, external data sources, or external tables for every database. Keeping the databases on the same managed instance also avoids network hops between separate logical servers, helping minimize query latency. The instance remains a PaaS offering, so Microsoft handles patching and infrastructure, unlike SQL Server on Azure Virtual Machines. Therefore option D satisfies all three requirements.

Why the Other Options Are Wrong

Azure SQL Database can span databases only with Elastic Query, which requires per-database external data sources and external tables and therefore does not minimize development effort. SQL Server on Azure Virtual Machines supports cross-database T-SQL, but it is IaaS, so you must manage the OS, patching, high availability, and tuning, which conflicts with minimizing development effort. Azure SQL Edge is an edge/IoT-optimized engine, not a central multi-database storage recommendation for an Azure app, and it does not simplify cross-database querying. None of these options align as well as Managed Instance with the combination of simultaneous cross-database queries, low effort, and low latency.

Community Comment Notes

The community comment from gpais argues that Azure SQL Managed Instance provides "Zero-Code Cross-Queries" and "Native T-SQL" cross-database support, avoiding the manual setup of database master keys, scoped credentials, external data sources, and external tables that Elastic Query requires. That aligns with the exam's emphasis on minimizing development effort rather than merely making cross-database queries possible. The comment also notes that SQL Server on Azure Virtual Machines can support cross-database queries, but it does not remove the managed-platform advantage of Managed Instance. This reinforces D as the best recommendation for the stated requirements.

Official Reference

Exam Strategy

When a scenario asks for cross-database queries, first separate native T-SQL support from Elastic Query. Count the setup objects each option requires—Managed Instance needs none for same-instance databases, while Azure SQL Database needs credentials, data sources, and external tables. Then use the 'minimize development effort' requirement to eliminate IaaS and edge options.

Frequently Asked Questions

Why is Azure SQL Database not the best fit for cross-database queries here?

Azure SQL Database requires Elastic Query objects such as external data sources and external tables, which adds setup work compared with Managed Instance's native T-SQL.

Does SQL Server on Azure VMs also support cross-database queries?

Yes, but it is IaaS and requires OS patching, HA, and performance tuning, so it does not minimize development effort like Managed Instance.

More AZ-305 FAQ →

Related Analysis

Practice All AZ-305 Questions

Access 95 questions with complete answers and detailed explanations.

View Full AZ-305 Practice Test →

← Back to AZ-305 Study Guide