in Education by
I have tried and tried, and can not get linked. I can connect to the server using SSMS, but can not link to it from a local server. Here is my script (replacing things in brackets with pertainent information): ----------- EXEC master.dbo.sp_addlinkedserver @server = N'[servername].database.windows.net', @srvproduct = N'Any', @provider = N'MSDASQL', @datasrc = N'Azure_ODBC1' GO EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'[servername]', @useself = N'False', @locallogin = NULL, @rmtuser = N'[username]', @rmtpassword = '[password]' GO Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Using SQL 2014, you should be able to do a distributed query between a local SQL server and an SQL Azure. First, create a Linked-Server: Linked Server (name): LinkedServerName Provider: Microsoft OLE DB Provider for SQL Server Product name: (blank) Data Source: azure-db.database.windows.net Provider string: (blank) Location: (blank) Catalog: db-name In security options: (*) Remote login: azure-user-name With password: yourPassword In SSMS entered the following test query: use [Local_DB] go Select * from [LinkedServerName].[RemoteDB].[dbo].[Remote_Table] It works fine. Moreover, you can refer this article for more information: https://www.sqlshack.com/create-linked-server-azure-sql-database/

Related questions

0 votes
    I have one SQL job which actually checks fragmentation % in DB of all the indexes and Rebuilds indexes if required. ... new to Azure. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have one SQL job which actually checks fragmentation % in DB of all the indexes and Rebuilds indexes if required. ... new to Azure. Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    How can a column with a default value be added to an existing table in SQL Server 2000 / SQL Server 2005? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    I have a store to get a list of something in system. To get information by business requirement, this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I have a setup in Azure with a bunch of resources combined in a resource group. I want my services to be ... it not impact anything? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    We have a few databases in Pricing Tier: Basic, S0... like below picture: These databases were created before a ... the Azure portal. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I'm trying to do a SQL Server 2008 setup and I've been given a Cross Language Installation failure ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I'm trying to do a SQL Server 2008 setup and I've been given a Cross Language Installation failure ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    This one will take some explaining. What I've done is create a specific custom message queue in SQL ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I need to remove a highly referenced table in a SQL Server database. How can I get a list of all the ... of the management studio.) Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    In SQL Server, it's possible to insert into a table using a SELECT statement: INSERT INTO Table (col1, col2, ... .id = other_table.id Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    Could anybody tell me where I can learn Microsoft SQL Server? Select the correct answer from above options...
asked Jan 6, 2022 in Education by JackTerrance
0 votes
    I am using Classic ASP and have the following VB script code From8to14 = date-14 To8to14 = date-8 This sets the two ... "& Day(From8to14) &"' " & _ "AND INTRAY.DateMatched...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    In order to create the proper queries I need to be able to run a query against the same datasource ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    Locked. This question and its answers are locked because the question is off-topic but has historical ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
...