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 Jobs Running Every 2 minutes...Bad Practice?

We have two servers, one is very slow and geographically far away. Setting up distributed queries is a headache because it does not always work (sometimes we receive a The semaphore timeout period has expired) and if the query works it can be slow.…
jmzagorski
  • 1,135
  • 18
  • 42
0
votes
1 answer

CTE with Linked Server: Mulitpart Identifier could not be bound

Interesting issue. I have the following CTE that JOINs some tables from a Linked Server which is our SAP data. This CTE is in a stored procedure and then executed via a SQL Server Agent Job on a timer (every 10 minutes). This ran fine for almost 20…
0
votes
1 answer

SQL Server : Linked Server row physical location

I can query the physical location of a row in Microsoft SQL Server by %%physloc%% identifier. For example like this select %%physloc%% from [testdb].[dbo].[table1_t4]; I have created a linked server of this SQL Server instance with dbserv instance.…
dmachop
  • 824
  • 1
  • 21
  • 39
0
votes
1 answer

What happens with OPENQUERY when the linked server is down/unavailable?

In a stored procedure on an SQL Server 2008 database, I've added an OPENQUERY in the FROM clause of a SELECT statement, and that in turn contains an OPENQUERY, something like this: SELECT MyField FROM OPENQUERY (LinkedServer, 'select…
MarioDS
  • 12,895
  • 15
  • 65
  • 121
0
votes
1 answer

SQL multiple assignment variable only has 1 (one) row

In SQL, if you have a query like this: SELECT @text = @text + FirstName + ', ' FROM Persons This normally produces a @text variable of 'John, Jack, Pete, ' etc. However, in my case this query: SELECT @text = @text + FirstName + ', ' FROM…
Mr. TA
  • 5,230
  • 1
  • 28
  • 35
0
votes
0 answers

Underperforming parameterized query on a linked server

DECLARE @FROMDATE datetime, @TODATE datetime SET @FROMDATE = getdate()-30 SET @TODATE = getdate() SELECT col1,col2, col3, datecolumn from [linked_server].[database].[dbo].[view] WHERE datecolumn BETWEEN @FROMDATE and @TODATE When this query is…
0
votes
1 answer

Issue with linked servers...absolute novice

I've got 2 instances on the same sql server that someone needs to be able to run a query to compare data. His original error with the query was regarding sys.servers and it not being able to find it. I've created a link to the other instance…
Andy J
  • 1
0
votes
1 answer

Entity Framework with Linked Database and SQL Views

I am trying to use Entity Framework 6.1.1 in Visual Studio 2013 with C#. I am using SQL Server 2012 in the back end. I have tested a regular SQL Server database which works fine. I used the Database First design pathway. I have a database that is…
0
votes
0 answers

Infinite loop within oracle packacged function

Following function goes into infinite loop.. function ftCustomerCatalog(comno varchar2,cpls varchar2, cuno varchar2) return tblCustomerCatalog pipelined is c sys_refCursor; r recCustomerCatalog; sq varchar2(3000); begin sq:='select …
TonyP
  • 5,655
  • 13
  • 60
  • 94
0
votes
1 answer

'ad hoc access to OLEDB provider denied' after trying VBA addin on different client machine

I have a stored procedure in SQL 2008 that has been used for many years without problems. Here is a relevant snippet (part of an INSERT INTO table SELECT block with only few columns shown): INSERT INTO dbo.myTemp_Excel SELECT 'PropertyState' =…
John Adams
  • 4,773
  • 25
  • 91
  • 131
0
votes
2 answers

Cannot See Stored Procedure on Linked Server

First, I know the syntax of calling a procedure on a linked server and I am familiar with the RPC and RPC Out server options at a basic level. What I am being told is that a procedure I created cannot be seen by navigating the tree of the linked…
CodenameCain
  • 573
  • 1
  • 9
  • 22
0
votes
0 answers

how to handle dates before 2000 through linked server in SQL Server 2012?

I have linked server established from firebird database to SQL Server 2012 and looks like when copying data the dates before 2000 year appears as 30-13-1899, why is that? anyway to go around this weird behavior? I copy data like this: SELECT * into…
Zulu Z
  • 1,103
  • 5
  • 14
  • 27
0
votes
1 answer

UPDATE local MSSQL table from Identical MySQL Linked Server Table Where Clause

I have two tables both named employer. One table resides on a MSSQL the other on a MySQL. The MySQL DB has been Linked. I'm trying to update all rows in the MSSQL DB table with the data from the MySQL DB where the data is different. Ideally,…
0
votes
3 answers

Create Linked Server at MS SQL to Oracle

I was wondering how to create synonym at MS SQL Server that will link my Oracle database? My tables all are at Oracle database. Thanks in advance.
4 Leave Cover
  • 1,248
  • 12
  • 40
  • 83
0
votes
0 answers

Update Local MS SQL Table from Linked Server (MySQL) Table

I'm trying to update a local MSSQL Table from a Linked Server Table (MySQL). The tables on both the servers have identical columns.The only difference between these tables is the name of MSSQL Table is employer and the name of MySQL Table is…