Azure Synapse、Azure SQL 数据库、Azure 托管实例和本地 SQL 服务器中的跨数据库查询

Cross Database Queries in Azure Synapse, Azure SQL Database, Azure Managed Instance and On Premise SQL Server

我们正在寻找将我们的本地 SQL 服务器迁移到 Azure 的选项,并试图了解如果我们的数据驻留在跨数据库中,我们是否能够 运行 跨数据库查询Azure(特别是 Azure 托管实例、Azure Synapse Analytics、Azure SQL 数据库)和本地 SQL 服务器实例中的多种数据库技术。

我们在任何地方都找不到太多关于这些是否受支持的信息,如果您能帮助填写下面的 table,我们将不胜感激:

TO-> Azure SQL DB Azure Managed Instance Azure Synapse Analytics On Premise SQL Server
Azure SQL DB Supported through Elastic Search Query (Ref: https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/) ? Azure Data Share supports sharing of both tables and views from Azure SQL Database and Azure Synapse Analytics (formerly Azure SQL DW), and sharing of tables from Azure Synapse Analytics (workspace) dedicated SQL pool. Sharing from Azure Synapse Analytics (workspace) serverless SQL pool is not currently supported. (Ref: https://docs.microsoft.com/en-us/azure/data-share/how-to-share-from-sql) Azure SQL database doesn't support the linked server property so you wont be able to access on prem tables in Azure SQL database and the elastic query in Azure SQL database is to query tables between 2 Azure SQL databases and not On prem. (Ref: https://docs.microsoft.com/en-us/answers/questions/289105/how-can-i-query-on-premise-sql-server-database-fro.html)
Azure Managed Instance ? ? ? Available through the use of Linked Servers (Ref: http://thewindowsupdate.com/2019/03/22/lesson-learned-81-how-to-create-a-linked-server-from-azure-sql-managed-instance-to-sql-server-onpremise-or-azure-vm/)
Azure Synapse Analytics ? ? ? ?
On Premise SQL Server ? ? ? Using a linked server you can query data in an Azure SQL database from an on premised SQL Server (Ref: https://docs.microsoft.com/en-us/answers/questions/289105/how-can-i-query-on-premise-sql-server-database-fro.html)

据我所知,没有提供单一接口同时与多个数据库对话的跨数据库外观。无论是 on-prem/in-cloud 还是 SQL-Server/Synapse/MySQL/...

您可以通过多种方式从 somewhere/anywhere 访问单个数据库。例如。从云中的代码访问本地数据库或从本地“服务器”上的代码 运行 访问云数据库。可用接口列表特定于每个“源”和“目标”组合。

AzureSQL数据库需要elastic query实现跨库查询。不支持创建链接服务器。

Azure 托管实例与本地 SQL 服务器具有几乎相同的功能,您可以使用 USE statement 执行跨数据库查询。与本地 SQL 服务器相同。

Azure Synapse Analytics 也不支持跨数据库查询。

根据我的知识和经验,我会在table中打上✔或X来表示支持或不支持。请参考:

TO-> Azure SQL DB Azure Managed Instance Azure Synapse Analytics On Premise SQL Server
Azure SQL DB Supported through Elastic Search Query (Ref: https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/) X, not supported Azure Data Share supports sharing of both tables and views from Azure SQL Database and Azure Synapse Analytics (formerly Azure SQL DW), and sharing of tables from Azure Synapse Analytics (workspace) dedicated SQL pool. Sharing from Azure Synapse Analytics (workspace) serverless SQL pool is not currently supported. (Ref: https://docs.microsoft.com/en-us/azure/data-share/how-to-share-from-sql) Azure SQL database doesn't support the linked server property so you wont be able to access on prem tables in Azure SQL database and the elastic query in Azure SQL database is to query tables between 2 Azure SQL databases and not On prem. (Ref: https://docs.microsoft.com/en-us/answers/questions/289105/how-can-i-query-on-premise-sql-server-database-fro.html)
Azure Managed Instance X, not supported ✔,same with local SQL Server X, not supported Available through the use of Linked Servers (Ref: http://thewindowsupdate.com/2019/03/22/lesson-learned-81-how-to-create-a-linked-server-from-azure-sql-managed-instance-to-sql-server-onpremise-or-azure-vm/)
Azure Synapse Analytics Azure Data Share X, not supported X, not supported X, not supported
On Premise SQL Server ✔,linked server ✔,linked server X, not supported Using a linked server you can query data in an Azure SQL database from an on premised SQL Server (Ref: https://docs.microsoft.com/en-us/answers/questions/289105/how-can-i-query-on-premise-sql-server-database-fro.html)

请根据您的要求选择suitable Azure数据库版本。

HTH.