{"id":198,"date":"2019-02-22T09:00:45","date_gmt":"2019-02-22T14:00:45","guid":{"rendered":"https:\/\/www.sqlskills.com\/blogs\/tim\/?p=198"},"modified":"2019-02-22T03:15:52","modified_gmt":"2019-02-22T08:15:52","slug":"how-to-create-a-linked-server-to-azure-sql-database-via-sql-server-management-studio","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/tim\/how-to-create-a-linked-server-to-azure-sql-database-via-sql-server-management-studio\/","title":{"rendered":"How to create a linked server to Azure SQL Database via SQL Server Management Studio"},"content":{"rendered":"<p>Often, I need to create a linked server to an Azure SQL Database to run queries against it or schedule maintenance. Creating a linked server to an Azure SQL Database is slightly different than how you\u2019ve likely been creating linked servers to other SQL Servers in your environment.<\/p>\n<p>When expanding \u2018Server Objects\u2019 and right clicking \u2018Linked Servers\u2019 and selecting \u2018New Linked Server\u2026\u2019 to create a linked server, most dbas initial instinct is to list the linked server name as the Azure server name and to use the server type of SQL Server. This would be incorrect, although it would still let you create the linked server with those values. Instead, use a friendly name for the Azure SQL Database as the linked server name. Then choose \u2018other database source\u2019 and list your Azure server as the \u2018data source\u2019. Next to catalog you\u2019ll need to specify the Azure SQL Database name.<\/p>\n<p><a href=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-195\" src=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer.jpg\" alt=\"AzureDBlinkedServer\" width=\"703\" height=\"629\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer.jpg 703w, https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer-300x268.jpg 300w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><\/a><\/p>\n<p>Next click on the security page and choose \u2018Be made using this security context\u2019 if you want to persist the connection information. Type in your username and password and click OK.<\/p>\n<p><a href=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer2.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-196\" src=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer2.jpg\" alt=\"AzureDBlinkedServer2\" width=\"701\" height=\"633\" srcset=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer2.jpg 701w, https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer2-300x271.jpg 300w\" sizes=\"(max-width: 701px) 100vw, 701px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>You should now see your linked server under &#8216;Server Objects&#8217;, &#8216;Linked Servers&#8217;. Expand your linked server and you&#8217;ll be able to browse the catalog to see your tables and views. You can now reference the linked server as needed.<\/p>\n<p><a href=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer3.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-197\" src=\"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-content\/uploads\/2019\/02\/AzureDBlinkedServer3.jpg\" alt=\"AzureDBlinkedServer3\" width=\"263\" height=\"201\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often, I need to create a linked server to an Azure SQL Database to run queries against it or schedule maintenance. Creating a linked server to an Azure SQL Database is slightly different than how you\u2019ve likely been creating linked servers to other SQL Servers in your environment. When expanding \u2018Server Objects\u2019 and right clicking [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,6,68],"tags":[32,80,81,36],"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/posts\/198"}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/tim\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}