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

Multi linked server query

I have a Foxpro database that I must query from a 64 bit SQL server. I can't link it directly, so I installed a 32 bit SQL server and linked Foxpro correctly. Then I linked the 64 bit server with the 32 bit SQL server. Now, how can I query the…
0
votes
0 answers

How to check if linked server is running within a function?

I know that there is a way to check if the linked server is running. I wanna know if there is a way to check it inside a function I wrote this code: create function dbo.Ck_DB_Stat (@servername nvarchar (20)) returns bit AS BEGIN declare @srvr…
DnL
  • 141
  • 1
  • 2
  • 17
0
votes
1 answer

Cross server EXEC

I have a several linked servers, with mass of DB's and tons of views and tables. The database names are like random set of letters and numbers and does not make any sense for me. Need to find on which server is certain view. DECLARE @servers AS…
Yurgen
  • 123
  • 1
  • 13
0
votes
2 answers

Unable to update table containing hyphens in Linked Server to Progress Database using 10.2B ODBC drivers

I currently am using a Linked Server connection in Sql Server 2008 R2 to a Progress database using 10.2B ODBC drivers from Progress. I need to update a table, but the table name contains a hyphen and the fields all contain hyphens. I see this…
0
votes
1 answer

How to force SQL to use linked server not the original sever

I have added a linked server 'LinkedServer2' (which is linked to 'OriginalServer2') to my LocalServer. Sometimes I have an issue that it either sees only my LocalServer or the OriginalServer2. And it is a fiasco because I cannot join to tables. How…
Przemyslaw Remin
  • 6,276
  • 25
  • 113
  • 191
0
votes
3 answers

Linked Server in SQL Server?

Is it possible to create database in linked server? If yes then how. I appreciate your help. Thank You.
user329592
  • 131
  • 1
  • 1
  • 4
0
votes
1 answer

How to get the result sets from tsql's execute?

I try to remotely query table-valued function as it is offered in this SO answer. But I stumbled over how to get the returned result sets to further work with them in sql code... Calling UDF remotely is not supported by SQL Server and openquery…
Pavel Voronin
  • 13,503
  • 7
  • 71
  • 137
0
votes
1 answer

ORA-04052: error occurred when looking up remote object OWNER.FUNCTION_NAME@DB_LINK Oracle 11g to 10g

I'm running an oracle 11g database that needs to run queries on a remote Oracle 10g database. To do this I created a database link on my 11g system. The link works fine with ordinary SQL queries. E.g: SELECT * FROM table_name@db_link work…
0
votes
1 answer

SQL Linked Server to UTF-8 database

I am trying to create a linked server from SQL Server 2008 R2 to an SAP IQ database, which has the UTF-8 Charset. I am unable to get the correct characterset viewable on queries using this linked server. I have tried everything, using native OLE DB…
H. Westerhof
  • 45
  • 1
  • 6
0
votes
1 answer

ODBC Linked server in sql 2005 doesn’t work from remote box

I have a dev workstation with sql 2005 installed and in it I created a linked server to a odbc connection to a clarion database. I can run select statements against it inside sql Mgt studio. When I take a second workstation and connect to the sql on…
user93383
  • 81
  • 1
0
votes
0 answers

SQL Server 2008R2: Linked server stored procedure to alter view failing

Our product inserts application data into a table utilizing two different databases [DB1],[DB2]. I've been asked to implement a high availability purge without having the Development Team update connection strings in code to point to a single…
0
votes
2 answers

Trying to import large data from Oracle using a Linked Server on MS SQL 2005

I'm trying to import large amount of data from an Oracle database using a Linked Server on MS SQL 2005. Here's the OPENQUERY command. SELECT * from OPENQUERY(HRDEV9, 'SELECT EMPLOYEE_ID ,EMPLOYEE_NAME …
Shant H.
  • 63
  • 1
  • 1
  • 10
0
votes
2 answers

Linked server can't start distributed transaction in trigger

I have a trigger that calls a stored proc. In the stored proc there's an INSERT statement on a Linked Server that gives me: The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "MyServer" was unable to begin a…
Cameron Castillo
  • 2,712
  • 10
  • 47
  • 77
0
votes
1 answer

MSDTC error when running query in a transaction for a Linked SQL server

I have a linked SQL server (the two servers are on two separate continents and connected via VPN). When running the following sql, it returns the data without issue: Select TOP 1 * from [LinkedServer].DB.DBO.Table1 When running it in a…
ricky89
  • 1,326
  • 6
  • 24
  • 37
0
votes
1 answer

Query SQL Linked Server only pulling data from one server

I have four SQL Servers that are named in the following way: dbs dbs2 dbs3 dbs4 I have a table that is on dbs3 called table1 in database1. This table does not exist on the other servers. However when I run the query: select * from…
smsranger
  • 3
  • 1