{"id":5150,"date":"2015-10-15T00:00:00","date_gmt":"2015-10-15T07:00:00","guid":{"rendered":"https:\/\/azure.microsoft.com\/blog\/querying-remote-databases-in-azure-sql-db"},"modified":"2025-09-17T09:55:59","modified_gmt":"2025-09-17T16:55:59","slug":"querying-remote-databases-in-azure-sql-db","status":"publish","type":"post","link":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/","title":{"rendered":"Cross-Database Queries in Azure SQL Database"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">NOTE: The <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/sql-database\/sql-database-elastic-query-overview\">Azure SQL Database elastic query overview (preview)<\/a> documentation has the latest and most relevant information on elastic database queries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We are happy to announce a number of significant improvements to <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/sql-database-elastic-query-overview\/?wt.mc_id=WW_CE_DM_OO_BLOG_NONE\">elastic database query<\/a> in Azure SQL Database. Most notably, elastic database query now supports querying across databases in Azure SQL Database. This makes possible common cross-database querying tasks like selecting from a remote table into a local table.<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.webp\" alt=\"T-SQL Query diagram\n\" class=\"wp-image-9500 webp-format\" title=\"Cross-database queries in Azure SQL Database\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.webp\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It also allows for richer remote database querying topologies like the one illustrated in the following figure where a number of databases need access to each others tables.<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/f598f588-f8ae-4e89-b1c3-21e2e025907b.webp\" alt=\"diagram\" class=\"wp-image-9502 webp-format\" style=\"width:709px;height:auto\" title=\"Querying remote databases in Azure SQL Database\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/f598f588-f8ae-4e89-b1c3-21e2e025907b.webp\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This new cross-database querying capability complements the existing support in elastic database query for horizontal partitioning (sharding)&nbsp;which is illustrated in the following figure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"248\" class=\"wp-image-9504\" style=\"width: 650px\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/fed8945e-4213-40c3-a514-4a608d4c67f4.png\" alt=\"elastic database query\"><br>In contrast to SQL Server on-premises, elastic database query in Azure SQL Database now unifies both vertical and horizontal partitioning under one common concept and the same surface area.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enhancements in the latest refresh of the elastic database query preview include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Improved support for common cross-database query scenarios that do not\u00a0involve sharding,<\/li>\n\n\n\n<li class=\"wp-block-list-item\">Elastic query is now available in both Standard and Premium performance tiers,<\/li>\n\n\n\n<li class=\"wp-block-list-item\">Flexible DDL now allows schema and table name aliases to represent remote database tables,<\/li>\n\n\n\n<li class=\"wp-block-list-item\">Performance is significantly improved for queries that involve T-SQL parameters when referencing remote tables,<\/li>\n\n\n\n<li class=\"wp-block-list-item\">Performance improvements for queries that retrieve large numbers of rows from remote databases,<\/li>\n\n\n\n<li class=\"wp-block-list-item\">Parameter support in the sp_execute_fanout procedure.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">See the following paragraphs for more details on those enhancements.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"querying-remote-databases\">Querying remote databases<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Elastic database query now provides access to tables in remote Azure SQL Databases through a simple extension in the DDL for external data sources and external tables. You can define an external data source that, for instance, provides access to a remote database which stores reference data shared among all databases of your data tier. You can also easily copy the contents of tables from a remote database to another using a INSERT INTO&#8230; SELECT statement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">External data sources that refer to a single remote database are identified by using the RDBMS option in the TYPE clause of the following DDL statement:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE EXTERNAL DATA SOURCE RemoteReferenceData\nWITH\n(\n TYPE=RDBMS,\n LOCATION='myserver.database.windows.net',\n DATABASE_NAME='ReferenceData',\n CREDENTIAL= SqlUser\n);\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Based on this external data source, you can now define an external table that provides remote access to a ZIP codes table located in the ReferenceData database.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE EXTERNAL TABLE [dbo].[zipcode](\n [zc_id] int NOT NULL,\n [zc_cityname] nvarchar(256) NULL,\n [zc_zipcode] nvarchar(20) NOT NULL,\n [zc_country] nvarchar(5) NOT NULL\n)\nWITH\n(\n DATA_SOURCE = RemoteReferenceData\n);\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">After this simple one-time setup, your queries can now access the remote ZIP code table from any Azure SQL Database where the external data source and external table have been defined.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"availability-across-more-performance-tiers\">Availability across more performance tiers<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Elastic database query is now also available in the Standard performance tier of Azure SQL Database. This significantly lowers the cost of entry for cross-database querying and partitioning scenarios in Azure SQL Database. Due to the smaller DTU limits in the Standard tier, it can take up to one minute to initialize elastic database query when you run your first remote database query. Initialization latency for elastic database query is an area we are actively working on. The experience will improve over the next couple of months.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"more-flexible-naming\">More flexible naming<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Several important scenarios require the ability to name your external table differently than the original table on the remote database. Any scenario where a local table already exists with the same name as your remote table are examples of that. All of these scenarios require the ability to use an alias for the remote table name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, consider a scenario where you want an external table definition to aggregate a DMV (Dynamic Management View) across a horizontally partitioned (sharded) data tier. Previously, this required complicated workarounds such as effectively renaming the DMV using a view on the remote databases and referring to the view from the external table definition. This was necessary since DMV names or catalog names already existed locally and could not be used directly as external table names.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can use any name as your external table name and identify the underlying remote table using the new OBJECT_SCHEMA and OBJECT_NAME clauses on the external table DDL. This makes it easy to query across DMVs or catalog views of your scaled-out data tier, as the following example shows. The following DDL (Data Definition Language) performs the one-time setup of the external data source and external table. Note the use of the OBJECT_SCHEMA and OBJECT_NAME clauses in the external table definition:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE EXTERNAL DATA SOURCE MyExtSrc\nWITH\n(\n TYPE=SHARD_MAP_MANAGER,\n LOCATION='myserver.database.windows.net',\n DATABASE_NAME='ShardMapDatabase',\n CREDENTIAL= SMMUser,\n SHARD_MAP_NAME='ShardMap'\n);\n \n\nCREATE EXTERNAL TABLE [dbo].[all_dm_exec_requests](\n [session_id] smallint NOT NULL,\n [request_id] int NOT NULL,\n [start_time] datetime NOT NULL, \n [status] nvarchar(30) NOT NULL,\n [command] nvarchar(32) NOT NULL,\n [sql_handle] varbinary(64),\n [statement_start_offset] int,\n [statement_end_offset] int,\n [cpu_time] int NOT NULL\n)\nWITH\n(\n DATA_SOURCE = MyExtSrc,\n SCHEMA_NAME = 'sys',\n OBJECT_NAME = 'dm_exec_requests',\n DISTRIBUTION=ROUND_ROBIN\n);\nNow you can retrieve the most expensive requests across your whole data tier with a simple elastic database query like the following:\n\nSELECT TOP 10 \n [request_id],\n [start_time]\n [status],\n [command]\nFROM all_dm_exec_requests\nORDER BY [cpu_time] DESC\n<\/pre><\/div>\n\n\n<h1 class=\"wp-block-heading\" id=\"new-signature-for-sp-execute-fanout\">New signature for sp_execute_fanout<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Elastic database query provides the stored procedure sp_execute_fanout to invoke stored procedures and functions on remote databases. Our recent improvements to Azure SQL Database now align the signature of sp_execute_fanout with the familiar signature for sp_executesql. This allows passing regular SQL parameters into invocations of sp_execute_fanout and will be available early next week.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"performance-improvements\">Performance improvements<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Previously, elastic database query could not push parameterized operations to remote databases. As a result, sometimes large row sets had to be unnecessarily brought local to evaluate these operations. With the recent improvements, parameterized operations can now be pushed to remote databases and be evaluated remotely. For a query over an external table and a local table like the following, this can now avoid transferring millions of rows by evaluating the selective filter in the WHERE clause on the remote database:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nDECLARE @low int\nDECLARE @high int\nSET @low = 100\nSET @high = 200\n\nSELECT c.CustomerId, c.Name, count(OrderId) \nFROM remote_customers c\nJOIN local_orders o\nON c.CustomerId = o.CustomerId \nWHERE c.CustomerId > @low and c.CustomerId < @high\nGROUP BY c.CustomerId, c.Name\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">A quick look into the query plan for the query above confirms that the range predicate on customer ID in the WHERE clause made it successfully into the remote query operator.<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/2031353a-5130-4eb2-82c0-6477802ad9ac.webp\" alt=\"Code screenshot\" class=\"wp-image-9506 webp-format\" title=\"Improved performance for parameterized remote operations\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/2031353a-5130-4eb2-82c0-6477802ad9ac.webp\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we also made transferring large numbers of small rows with elastic database query more efficient. Our tests show performance improvements for queries over external tables by a factor of more than five when transferring 100,000 rows or more.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To learn more about all the improvements discussed above, please visit the&nbsp;<a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/sql-database-elastic-query-overview\/?wt.mc_id=WW_CE_DM_OO_BLOG_NONE\">elastic database query<\/a>&nbsp;overview.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog announces the new cross-database querying capabilities in Azure SQL Database and other improvements to elastic database query.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","_alt_title":"","footnotes":"","msx_community_cta_settings":[]},"categories":[1473,1466],"tags":[],"audience":[3057,3055,3056],"content-type":[1511],"product":[1539],"tech-community":[],"topic":[],"coauthors":[97],"class_list":["post-5150","post","type-post","status-publish","format-standard","hentry","category-databases","category-hybrid-multicloud","audience-data-professionals","audience-developers","audience-it-implementors","content-type-best-practices","product-azure-sql-database","review-flag-5-1680286581-950","review-flag-new-1680286579-546"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cross-Database Queries in Azure SQL Database | Microsoft Azure Blog<\/title>\n<meta name=\"description\" content=\"This blog announces the new cross-database querying capabilities in Azure SQL Database and other improvements to elastic database query.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cross-Database Queries in Azure SQL Database | Microsoft Azure Blog\" \/>\n<meta property=\"og:description\" content=\"This blog announces the new cross-database querying capabilities in Azure SQL Database and other improvements to elastic database query.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Azure Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/microsoftazure\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-15T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-17T16:55:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.png\" \/>\n<meta name=\"author\" content=\"Microsoft Azure\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@azure\" \/>\n<meta name=\"twitter:site\" content=\"@azure\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Azure\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/\"},\"author\":[{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/microsoft-azure\/\",\"@type\":\"Person\",\"@name\":\"Microsoft Azure\"}],\"headline\":\"Cross-Database Queries in Azure SQL Database\",\"datePublished\":\"2015-10-15T07:00:00+00:00\",\"dateModified\":\"2025-09-17T16:55:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/\"},\"wordCount\":965,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.png\",\"articleSection\":[\"Databases\",\"Hybrid + multicloud\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/\",\"name\":\"Cross-Database Queries in Azure SQL Database | Microsoft Azure Blog\",\"isPartOf\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.png\",\"datePublished\":\"2015-10-15T07:00:00+00:00\",\"dateModified\":\"2025-09-17T16:55:59+00:00\",\"description\":\"This blog announces the new cross-database querying capabilities in Azure SQL Database and other improvements to elastic database query.\",\"breadcrumb\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.webp\",\"contentUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.webp\",\"width\":702,\"height\":255,\"caption\":\"T-SQL Query diagram\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog home\",\"item\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/databases\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cross-Database Queries in Azure SQL Database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#website\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\",\"name\":\"Microsoft Azure Blog\",\"description\":\"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.\",\"publisher\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\",\"name\":\"Microsoft Azure Blog\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp\",\"contentUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp\",\"width\":512,\"height\":512,\"caption\":\"Microsoft Azure Blog\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/microsoftazure\",\"https:\/\/x.com\/azure\",\"https:\/\/www.instagram.com\/microsoftdeveloper\/\",\"https:\/\/www.linkedin.com\/company\/16188386\",\"https:\/\/www.youtube.com\/user\/windowsazure\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/c702e5edd662b328b49b7e1180cab117\",\"name\":\"shakir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"caption\":\"shakir\"},\"sameAs\":[\"https:\/\/azure.microsoft.com\"],\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/shakir\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cross-Database Queries in Azure SQL Database | Microsoft Azure Blog","description":"This blog announces the new cross-database querying capabilities in Azure SQL Database and other improvements to elastic database query.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/","og_locale":"en_US","og_type":"article","og_title":"Cross-Database Queries in Azure SQL Database | Microsoft Azure Blog","og_description":"This blog announces the new cross-database querying capabilities in Azure SQL Database and other improvements to elastic database query.","og_url":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/","og_site_name":"Microsoft Azure Blog","article_publisher":"https:\/\/www.facebook.com\/microsoftazure","article_published_time":"2015-10-15T07:00:00+00:00","article_modified_time":"2025-09-17T16:55:59+00:00","og_image":[{"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.png","type":"","width":"","height":""}],"author":"Microsoft Azure","twitter_card":"summary_large_image","twitter_creator":"@azure","twitter_site":"@azure","twitter_misc":{"Written by":"Microsoft Azure","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#article","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/"},"author":[{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/microsoft-azure\/","@type":"Person","@name":"Microsoft Azure"}],"headline":"Cross-Database Queries in Azure SQL Database","datePublished":"2015-10-15T07:00:00+00:00","dateModified":"2025-09-17T16:55:59+00:00","mainEntityOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/"},"wordCount":965,"commentCount":0,"publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.png","articleSection":["Databases","Hybrid + multicloud"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/","name":"Cross-Database Queries in Azure SQL Database | Microsoft Azure Blog","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.png","datePublished":"2015-10-15T07:00:00+00:00","dateModified":"2025-09-17T16:55:59+00:00","description":"This blog announces the new cross-database querying capabilities in Azure SQL Database and other improvements to elastic database query.","breadcrumb":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#primaryimage","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/10\/1f82097d-56e9-46c7-8c6a-5d557d8753f5.webp","width":702,"height":255,"caption":"T-SQL Query diagram"},{"@type":"BreadcrumbList","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/querying-remote-databases-in-azure-sql-db\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog home","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Cross-Database Queries in Azure SQL Database"}]},{"@type":"WebSite","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","name":"Microsoft Azure Blog","description":"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.","publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization","name":"Microsoft Azure Blog","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","width":512,"height":512,"caption":"Microsoft Azure Blog"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/microsoftazure","https:\/\/x.com\/azure","https:\/\/www.instagram.com\/microsoftdeveloper\/","https:\/\/www.linkedin.com\/company\/16188386","https:\/\/www.youtube.com\/user\/windowsazure"]},{"@type":"Person","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/c702e5edd662b328b49b7e1180cab117","name":"shakir","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4","url":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","caption":"shakir"},"sameAs":["https:\/\/azure.microsoft.com"],"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/shakir\/"}]}},"msxcm_display_generated_audio":false,"msxcm_animated_featured_image":null,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Azure Blog","distributor_original_site_url":"https:\/\/azure.microsoft.com\/en-us\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/5150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/comments?post=5150"}],"version-history":[{"count":1,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/5150\/revisions"}],"predecessor-version":[{"id":46522,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/5150\/revisions\/46522"}],"wp:attachment":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/media?parent=5150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/categories?post=5150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tags?post=5150"},{"taxonomy":"audience","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/audience?post=5150"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/content-type?post=5150"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/product?post=5150"},{"taxonomy":"tech-community","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tech-community?post=5150"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/topic?post=5150"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/coauthors?post=5150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}