Standard Operating Procedure

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.

Tool: Endrias Bridge v1.3.137+  ·  Source: SQL Server 2016+ on-prem or VM  ·  Target: Azure SQL Database Hyperscale elastic pool

📖 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:

⚠️
Preview feature. Hyperscale cross-database queries are in preview. Until your subscription has the preview enabled, Azure refuses every database-qualified name with error 40515 (“Reference to database and/or server name … is not supported in this version of SQL Server”), even inside a Hyperscale pool. The data, tables and same-database objects still migrate; only the cross-database objects wait. Request preview access from Microsoft before the migration window.
ℹ️
Keep the database names. Three-part names refer to databases by name, and Endrias Bridge does not rewrite them. Give each target database the same name as its source in the Map Targets step, or the references will point at databases that don’t exist.

⚙️ 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.

  1. Each job copies its tables and data, then applies its schema objects. Synonyms are created first, then views, functions, procedures and triggers.
  2. Objects that need a database that isn’t on the target yet are logged as waiting, not as failures.
  3. 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.
  4. 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

RequirementNotes
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 groupSame as the SQL Server → Azure SQL SOP
Azure SQL logical server with a Hyperscale elastic poolCreated in Step 2 below
Hyperscale cross-database queries (preview) enabled for the subscriptionNeeded 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 poolStandard 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 databaseThe 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 targetAuto-create runs CREATE DATABASE in master
Migration host’s public IP in the server firewallAzure Portal → SQL server → Networking
1

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.

2

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
💡
If Azure answers RegionDoesNotAllowProvisioning when you create the logical server, that region is not accepting new SQL servers for your subscription. Choose another region.
3

Create the Project

  1. Open Projects → + New Project. Set the target type to Azure SQL Database and the target server to <server>.database.windows.net.
  2. In Scan Source, select every database the assessment linked together.
  3. 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.
  4. 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 settingStatement Endrias Bridge runs
Elastic pool XdbHsPoolCREATE DATABASE [Sales] (SERVICE_OBJECTIVE = ELASTIC_POOL(name = [XdbHsPool]))
Service objective HS_Gen5_2CREATE DATABASE [Sales] (EDITION = 'Hyperscale', SERVICE_OBJECTIVE = 'HS_Gen5_2')
Both blankCREATE DATABASE [Sales] (the server’s default tier)
ℹ️
Creating a database in a Hyperscale pool takes a few minutes per database (typically 3–4 minutes). The job waits for it before copying data.
ℹ️
One database at a time? From v1.3.139 a single migration can do the same: on Step 5, set the target engine to Azure SQL Database and fill Create in elastic pool (or service objective, e.g. 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.
4

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.
5

Verify

  1. Confirm the databases are in the pool: az sql db list -g <rg> -s <server> --query "[].{name:name, pool:elasticPoolName}" -o table
  2. 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. USE can’t switch databases on Azure SQL Database (40508): open a new connection for each database.
  3. Query a view, a synonym and a procedure that use another database.
  4. Run Comparison for each database to confirm objects and row counts match the source.
6

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.

UsernameSigns in with
entraA browser window (Entra user, MFA supported). Signed in once per session; parallel workers share the token
entra:ana@contoso.comThe same, with that account pre-selected
entra-defaultYour 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.

ℹ️
Before connecting, an Entra admin creates the identity on the server: 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

ObjectBehaviour
Tables, data, keys, indexesMigrated per database, as in every SQL Server → Azure SQL migration
SynonymsCopied (new in v1.3.137), created before the views that use them
Views, functions, procedures, triggers with three-part namesCreated by the job if the other database is already there, otherwise by the cross-database pass
Four-part (linked server) namesReported by Assessment; can’t work on Azure SQL Database
Logins, users and permissionsNot 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

For the errors behind these messages, see Troubleshooting: cross-database objects.