SQL Server → Azure SQL Hyperscale (Related Databases)
Move a group of SQL Server databases that query each other into one Hyperscale elastic pool with Endrias Bridge, keeping their cross-database views, procedures, functions and synonyms working.
Overview & Scope
Many SQL Server applications use more than one database and join across them with three-part names (OtherDb.dbo.table) or synonyms. Azure SQL Database has historically rejected these references. Microsoft added cross-database queries for Hyperscale (preview, announced November 16, 2026) for databases in the same Hyperscale elastic pool, so these applications can now move without rewriting their queries.
This procedure migrates such a group with a Migration Project: one job per database, all targeting a single Hyperscale elastic pool. Endrias Bridge:
- reports every cross-database reference during Assessment, so you know which databases must move together;
- creates each target database inside the Hyperscale elastic pool you name;
- copies synonyms along with views, procedures, functions and triggers;
- after every database in the project has finished, runs a cross-database pass that creates the objects which had to wait for another database to arrive.
How the Cross-Database Pass Works
Jobs in a project run in parallel and finish in any order. A view such as SELECT … FROM Inventory.dbo.stock can only be created once Inventory exists on the target, and databases can reference each other in both directions. A single pass per database therefore cannot create every object.
- Each job copies its tables and data, then applies its schema objects. Synonyms are created first, then views, functions, procedures and triggers.
- Objects that need a database that isn’t on the target yet are logged as waiting, not as failures.
- When every job has finished, the project compares each source database’s objects with the target and applies the missing ones again, in rounds, until a round creates nothing new.
- Anything still missing is listed in each job’s log with the reason, and the job card shows how many objects still need another database.
Re-running is safe: views, functions, procedures and triggers are applied with CREATE OR ALTER, and synonyms are dropped and recreated.
Prerequisites
| Requirement | Notes |
|---|---|
| Endrias Bridge v1.3.137 or newer (v1.3.142 for Microsoft Entra sign-in and the cross-database write check) | Earlier versions don’t copy synonyms and have no cross-database pass |
SQL Server 2016+ source; login with db_datareader + VIEW SERVER STATE on every database in the group | Same as the SQL Server → Azure SQL SOP |
| Azure SQL logical server with a Hyperscale elastic pool | Created in Step 2 below |
| Hyperscale cross-database queries (preview) enabled for the subscription | Needed only for the cross-database objects; request it from Microsoft and wait for approval |
| All related databases on the same logical server and in the same Hyperscale elastic pool | Standard pools, other tiers and standalone databases are not supported by the preview |
A Microsoft Entra identity (user, group or managed identity) with a login in master and a user in every database | The preview accepts only Entra identities. SQL logins, contained users without a login, cross-tenant identities and service principals with secrets or certificates are out of scope. The migration itself can still use a SQL admin login; see Sign in with Microsoft Entra |
Server admin (or dbmanager) login for the target | Auto-create runs CREATE DATABASE in master |
| Migration host’s public IP in the server firewall | Azure Portal → SQL server → Networking |
Assess Each Database
Connect to each source database on Step 5 and click Run Assessment. The compatibility list now includes a cross-database line whenever the database references another one:
Cross-database references to XDB_Inventory from 4 object(s) (InvStock, fn_on_hand,
usp_low_stock_orders, vw_order_detail). Migrate that database in the same project so the
references resolve on the target. On Azure SQL Database this needs cross-database queries:
Hyperscale supports them (preview) for databases on the same server in the same Hyperscale
elastic pool, and only for Microsoft Entra logins (not SQL logins). Renaming a database or
moving it out of the pool breaks these references.
From v1.3.142 Assessment also lists stored code that writes to another database, directly or through a synonym, because the preview currently allows writes only to the database the connection opened:
Triggers that write to another database (dbo.trg_audit -> AuditDB.dbo.Log): on Azure SQL
Hyperscale cross-database queries (preview) the statement that fires the trigger fails with
error 46971 ...
Procedures/functions that write to another database (dbo.ReserveStock ->
InventoryDB.dbo.Inventory (via synonym)): Hyperscale cross-database queries (preview) currently
allow writes only to the database the connection opened ...
The check reads stored T-SQL only. It can’t see dynamic SQL, application code, or an UPDATE alias … FROM OtherDb.dbo.t alias statement, so review those by hand, and check whether the application or its ORM uses savepoints (SAVE TRANSACTION) or nested transactions, which the preview doesn’t support.
Include every database listed there in the same project. A linked-server line (four-part names such as LNK.Db.dbo.t) identifies an object that cannot run on Azure SQL Database. Rewrite it, or move the referenced data into a database in the same pool.
Create the Hyperscale Elastic Pool
Create the pool before running the project. Size it for the bulk load and scale it down after cutover.
az sql elastic-pool create -g <resource-group> -s <server> -n <PoolName> \
--edition Hyperscale --family Gen5 --capacity 4
RegionDoesNotAllowProvisioning when you create the logical server, that region is not accepting new SQL servers for your subscription. Choose another region.Create the Project
- Open Projects → + New Project. Set the target type to Azure SQL Database and the target server to
<server>.database.windows.net. - In Scan Source, select every database the assessment linked together.
- In Map Targets:
- keep Auto-create target database if it does not exist checked;
- enter the pool name in Azure SQL Database targets — create in elastic pool;
- keep each Target Database name the same as its source.
- Set the concurrency, choose Immediately as the schedule and click Launch Migration ▶.
Leave the pool name blank and fill or service objective instead (for example HS_Gen5_2) to create standalone Hyperscale databases. Standalone databases can’t use cross-database queries, so use the pool for related databases.
| Map Targets setting | Statement Endrias Bridge runs |
|---|---|
Elastic pool XdbHsPool | CREATE DATABASE [Sales] (SERVICE_OBJECTIVE = ELASTIC_POOL(name = [XdbHsPool])) |
Service objective HS_Gen5_2 | CREATE DATABASE [Sales] (EDITION = 'Hyperscale', SERVICE_OBJECTIVE = 'HS_Gen5_2') |
| Both blank | CREATE DATABASE [Sales] (the server’s default tier) |
HS_Gen5_2) in the Target Database box. From v1.3.140 the REST API ("elasticPool" in destination, also in databases batch mode) and the command line (--tgt-elastic-pool) can too: see the API Client SOP. Use a Migration Project when the databases reference each other, so the cross-database pass can create the objects that wait for another database.Run the Project and Read the Log
The jobs start when you launch the project. Each job’s log shows the database being created in the pool:
Created target DB [XDB_Sales]: CREATE DATABASE [XDB_Sales] (SERVICE_OBJECTIVE = ELASTIC_POOL(name = [XdbHsPool]))
During the schema-objects step, objects that need a database that hasn’t arrived yet are logged as waiting:
VIEW vw_order_detail: waiting for XDB_Inventory on the target - a project retries it after
all its databases finish; otherwise migrate that database, then Re-apply schema objects
Schema objects: applied 4, 2 waiting for other databases
After the last job, every job’s log gets the cross-database pass:
Cross-database pass: retrying 2 object(s) across 1 database(s) now that all are on the target
XDB_Sales: created vw_order_detail
XDB_Sales: created vw_stock_check
Without preview access, the pass ends like this instead, and the objects can be created later (Step 6):
XDB_Sales: VIEW vw_order_detail still FAILED - cross-database reference refused by Azure (40515)
Azure SQL Database refused the cross-database reference (40515). Put these databases in the same
Hyperscale elastic pool and enable Hyperscale cross-database queries (preview) on the
subscription, then re-apply schema objects.
Verify
- Confirm the databases are in the pool:
az sql db list -g <rg> -s <server> --query "[].{name:name, pool:elasticPoolName}" -o table - Connect to one target database as the Entra identity the application will use, not the SQL admin (a SQL login is refused for cross-database queries), and run a cross-database query, for example
SELECT COUNT(*) FROM OtherDb.dbo.SomeTable.USEcan’t switch databases on Azure SQL Database (40508): open a new connection for each database. - Query a view, a synonym and a procedure that use another database.
- Run Comparison for each database to confirm objects and row counts match the source.
Enabling Cross-Database Objects After Migration
No data needs to be copied again. Once the preview is enabled, connect the Migration tab to each database that logged 40515 (source and target) and click Re-apply Schema Objects. Objects that already exist are re-applied unchanged; the missing ones are created. Process the databases in any order, then repeat for any database that still reports a missing object.
Sign in with Microsoft Entra
Hyperscale cross-database queries accept only Microsoft Entra identities. From v1.3.142 Endrias Bridge can connect to SQL Server, Azure SQL Database and Managed Instance with Entra: type one of these in the Username field and leave the password empty.
| Username | Signs in with |
|---|---|
entra | A browser window (Entra user, MFA supported). Signed in once per session; parallel workers share the token |
entra:ana@contoso.com | The same, with that account pre-selected |
entra-default | Your az login, VS Code or environment credentials, or the host’s managed identity (no browser window; suits the command line and REST API) |
entra-msi / entra-msi:<client-id> | The Azure VM’s system-assigned or a user-assigned managed identity |
The same keywords work on Step 5, in Migration Projects (including Test Connection and Scan Source), the Jobs tab, the REST API and the command line. The bcp and PowerShell bulk-copy engines don’t take Entra tokens, so an Entra connection copies data through the ODBC engine; for the bulk load you can keep the server admin SQL login and use Entra to verify.
CREATE LOGIN [name] FROM EXTERNAL PROVIDER in master, then CREATE USER [name] FROM LOGIN [name] and the grants it needs in each database.What Migrates
| Object | Behaviour |
|---|---|
| Tables, data, keys, indexes | Migrated per database, as in every SQL Server → Azure SQL migration |
| Synonyms | Copied (new in v1.3.137), created before the views that use them |
| Views, functions, procedures, triggers with three-part names | Created by the job if the other database is already there, otherwise by the cross-database pass |
| Four-part (linked server) names | Reported by Assessment; can’t work on Azure SQL Database |
| Logins, users and permissions | Not created by Endrias Bridge. Create the Entra login in master and a user plus grants in every database; each database checks its own permissions |
| Writes to another database (procedures, triggers, synonyms, dynamic SQL) | Migrated as written, but fail at run time under the preview’s write rules (see Current Limits); flagged by Assessment from v1.3.142 |
Current Limits
- The cross-database pass runs for Migration Projects. A single migration from the Migration tab, the Jobs tab and the REST API’s
"databases"batch don’t run it: migrate the other databases, then use Re-apply Schema Objects. - Three-part names are not rewritten, so target database names must match the source names.
- Writes: today a connection can write only to the database it opened (the source database), while still reading any database in the pool. A procedure, trigger, synonym or dynamic SQL that writes to another database fails. Microsoft plans to allow one write database per transaction (the source or another one) during the preview; writing two databases in one transaction stays unsupported (error 46971). Until then, make those writes on a separate connection to that database, and reconcile if one commit succeeds and the other fails.
- A trigger that writes to another database always fails (46971), now and after the planned change.
- Savepoints (
SAVE TRANSACTION) and nested transactions aren’t supported; check what the application’s ORM does. - A schema-bound function can’t reference another database (4512); review row-level-security predicates that depend on another database. Don’t drop schema binding just to get past it.
- Four-part (linked server) names are not supported.
- Moving a database out of the pool, or renaming it, breaks the references to it. Coordinate moves, restores and failovers with Microsoft’s preview team.
- Limits are from Microsoft’s limited-preview guide (v3, 17 November 2026) and may change. Questions go to the preview team at
azuresql-crossdb@microsoft.com.
For the errors behind these messages, see Troubleshooting: cross-database objects.