Questions tagged [linked-server]

The SQL Server "linked server" feature makes it possible to execute commands, such as a SELECT statement, on a remote server.

Use this tag for any questions related to SQL Server's linked server feature.

A linked server configuration enables SQL Server to execute commands against OLE DB data sources on remote servers. Linked servers offer the following advantages:

  • Remote server access.
  • The ability to issue distributed queries, updates, commands, and transactions on heterogeneous data sources across the enterprise.
  • The ability to address diverse data sources similarly.

An OLE DB provider is required for this functionality to work.

See MSDN for more information.

1493 questions
0
votes
0 answers

SQL Server - Linked Server using ASEOLEDB

Has anyone managed to get a linked server working between SQL 2008R2 and Sybase ASE 15.7 using the SAP/Sybase OLE DB driver and not using an ODBC DSN? I've tried what seems like every combination of parameters to create the linked server both…
DR74
  • 1
0
votes
1 answer

Error when inserting into Informix Linked Server

I am working on an integration between a SQL Server database and an Informix database. The databases are running on separate servers. I have created a Linked Server to Informix using the Informix OLE DB provider. I am able to retrieve data from…
wooters
  • 829
  • 6
  • 24
0
votes
2 answers

Adding insert into linked server inside a trigger

I'm trying to run a trigger that allows me to insert the inserted data on my local table to the linked server's table. This is what I did: use [medb] ALTER TRIGGER [dbo].[trigger1] ON [dbo].[tbl1] AFTER INSERT AS BEGIN INSERT into…
marchemike
  • 3,179
  • 13
  • 53
  • 96
0
votes
2 answers

Best practice to recover an CRUD statement to a linked server if connection is lost

I am looking for the best practice for the following scenario. We have a CRM in our company. When an employee updates the record of a company, there is trigger that fires a stored procedure which has a CRUD statement to the linked server hosting the…
0
votes
0 answers

Execute stored procedure in javascript

I'm trying to execute a stored procedure in Javascript of this way: xmlhttpPost2(2,"BuscaProducto","EXEC GetProductStk"); But the browser says: Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection.…
Miguel Marroquin
  • 129
  • 1
  • 3
  • 10
0
votes
1 answer

Unable to find OraOLEDB.Oracle provider in the Linked Server Providers

I am trying to configure a Linked Server in SQL Server to Oracle database. However, I am unable to find OraOLEDB.Oracle in the providers list of the linked servers. Would you please guide me to find a solution to this issue ? Thank you :)
Akram Shahda
  • 14,655
  • 4
  • 45
  • 65
0
votes
0 answers

SQL Linked Server to Itself

I've got two database servers ServerX and ServerY, each with a linked server object to the other. I want to move a database from one to the other to increase the performance of some queries across the linked servers. Some views in the to-be-moved…
hughball
  • 50
  • 7
0
votes
2 answers

Getting Linked Server Database Tables and Views via SMO

How do I get SQL Server databases that are on a Linked Server via SMO? Server server = GetServer("server"); Database db = server.Databases["db"]; LinkedServer ls = server.LinkedServers["ls"]; The second line above returns a regular database. The…
as9876
  • 934
  • 1
  • 13
  • 38
0
votes
1 answer

T-SQL cursor for linked server INSERT SELECT

I'm trying to get this cursor loop to work, so I could copy data from linked server to another server. However it seems that the cursor is in a loop and does nothing. What am I doing wrong? /* For testing purposes I'm fetching data from …
user1054844
  • 922
  • 5
  • 17
  • 34
0
votes
2 answers

Sp to sync two tables using linked servers sql server

I'm working in a SP and I got two tables in different servers, one is the main and the other is a copy but whit less columns, all I want is to run the SP every 5 min over the main table in order to validate if new records has been created, if yes…
emancia
  • 1
  • 2
0
votes
1 answer

How to configure the Server name dynamically using linked servers

Here are the steps I have followed: Step1: I have created the Linked server . EXEC sp_addlinkedserver @server='servername', -- here you can specify the name of the linked server @srvproduct='', @provider='sqlncli', -- using SQL…
user1877936
  • 351
  • 3
  • 7
  • 22
0
votes
1 answer

How can I update over a linked server with code first migration?

I am using entity framework 6 with code first. During deployment I need to make an update across and existing linked server. When I try this I get: "MSDTC on server 'myLocal' is unavailable." This problem happens when running agianst my local…
0
votes
1 answer

SQL Server DBLlink to oracle returns numbers as string

I have an Oracle database containing my data and an SQL Server database getting the data from Oracle through DBLink. Problem is - all numbers from the Oracle tables are accepted at the SQL Server as nvarchar. As a result, when i try to filter the…
0
votes
0 answers

DELETE takes ages when using linkedserver

My problem is simple: I run some quite complex query using remote server and while this query runs as a charm ( <0s ) select t1.* from [linkedserver].[db].[dbo].[table1] t1 inner join [linkedserver].[db].[dbo].[table2] t2 on t1.t2ID = t2.ID WHERE…
fontan
  • 86
  • 10
0
votes
1 answer

How to parameterize linked server references in SSRS datasets?

I'm developing a ASP.NET web application that displays some SSRS reports. My application's database is located in a different server from my report's database, considering that reports consume data from both servers there's a linked server in report…
Antonio Correia
  • 1,093
  • 1
  • 15
  • 22