sqlazureazure-web-app-serviceazure-sql-databaseazure-elasticpool

Cross Database query is not working in Azure SQL elastic pool


I am having two different database in azure sql server i have a sp in which we are executing select statement from another database inside same server both database are in same elastic pool where they will share the resources but we are getting this issue

Reference to database and/or server name in 'AppVisionLens.AVL.PRJ_ConfigurationProgress' is not supported in this version of SQL Server.

![enter image description here][1]


Solution

  • An Elastic Pool is NOT the same as a physical SQL Server where multiple databases are hosted. It is purely a Resource Governance boundary where the allocated resources can be shared across multiple databases for cost benefits.

    By default, Azure SQL Database does not allow access outside of it's own database boundary. To achieve this you need to explicitly configure an external source with the appropriate credentials to allow a table from a different database to be queried.

    This is achieved using Elastic Database Queries