Cross Warehouse Queries in Fabric – Query Across Warehouses with T-SQL
In Microsoft Fabric, you can execute cross warehouse queries to join or fetch data from multiple warehouses within the same workspace using standard T-SQL. This is useful for creating unified reports, performing analytics across departments, or consolidating data silos.
๐ What Are Cross Warehouse Queries?
- Allows querying across two or more Fabric Warehouses
- Supports read-only access to external warehouse tables
- Uses
Linked Server-style
3-part or 4-part naming convention - Enables you to join data without ETL duplication
✅ Prerequisites
- Both warehouses must be in the same workspace
- You must have read permissions on the external warehouse
- SQL editor must be used within a Fabric Warehouse context
๐งช Example Query
Assume you are connected to SalesWarehouse
and want to pull data from FinanceWarehouse
:
SELECT o.OrderID, o.CustomerID, f.Balance
FROM dbo.Orders o
JOIN [FinanceWarehouse].[dbo].[CustomerAccounts] f
ON o.CustomerID = f.CustomerID;
This query joins the Orders
table from the current warehouse with the CustomerAccounts
table
from the FinanceWarehouse.
๐ฏ Use Cases
- Central reporting across multiple business domains
- Joining data from regional and global warehouses
- Performing data validation across systems
- Avoiding ETL and staging for short-term analytics
⚠️ Limitations
- Write operations (
INSERT
,UPDATE
) are not allowed on external warehouse tables - Performance depends on table sizes and Fabric capacity
- Cross queries are scoped to the same workspace only
- Only supported in SQL Editor, not in Dataflow Gen2 or Power BI visuals directly
๐ก Tips for Efficient Cross Warehouse Queries
- Use
TOP
orWHERE
clauses to limit data early - Apply indexing strategies on foreign keys in both warehouses
- Use
SELECT ... INTO
to materialize external data into local staging tables if needed repeatedly