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
12
votes
1 answer

Getting an Error on inserting data when using Linked Server Queries

UPDATE : The issue was col1 was hiereachyid type and even a select didnt work for it. Hi all, I am getting this error - Objects exposing columns with CLR types are not allowed in distributed queries. Please use a pass-through query to access…
Vishal
  • 12,133
  • 17
  • 82
  • 128
11
votes
4 answers

OPENROWSET or OPENDATASOURCE Example to get Data from .xlsx or .csv file on file system of Remote Server

There are plenty of examples around showing how to use OPENROWSET and OPENDATASOURCE to open queries against tables on remote SQL servers, and to get data from files on other servers. Unfortunately, none of them tell me how to do the specific thing…
Bruce Long
  • 713
  • 3
  • 9
  • 28
11
votes
2 answers

Performance effect of Synonyms over a linked server in SQL Server

On localserver (a SQL Server 2008 R2), I have a synonym called syn_view1 pointing to the linked server remoteserver.remotedb.dbo.view1 This SLOW query takes 20 seconds to run. select e.column1, e.column2 from syn_view1 e where e.column3 = 'xxx' …
11
votes
1 answer

Connect to IBM i server from Sql Server 2008 R2

I have a big deal: I have to connect (I just want to read data, not to write) to my customer's IBM AS/400 (aka iSeries, now IBM i) server... I think I have all parameters needed (given me by the AS/400 programmer), but I can't figure out which…
user1616663
10
votes
6 answers

Having trouble adding a linked SQL server

I'm trying to pull in data from a remote SQL Server. I can access the remote server using SQL authentication; I haven't had any luck using the same credentials with sp_addlinkedserver. I'm trying something like this: Exec sp_dropserver 'Remote',…
Herb Caudill
  • 50,043
  • 39
  • 124
  • 173
10
votes
3 answers

How to execute store procedure for another DB?

I have a stored procedure that should be able to be executed on any table of any database on my MS Sql Server. Most of the combination of EXEC and USE statements didn't result in anything. Here is the stored procedure: CREATE PROCEDURE…
Oleg Sakharov
  • 1,127
  • 2
  • 20
  • 19
10
votes
11 answers

Retrieve >901 rows from SQL Server 2008 linked server to Active Directory

In SQL Server 2008 (version 10.0.4000) I have created a linked server to an Active Directory server. This query: select TOP 901 * from openquery(adsisca, ' select givenName, sn, sAMAccountName from …
bgs264
  • 4,572
  • 6
  • 38
  • 72
10
votes
6 answers

Linking Server in SQL Server 2008 R2

Can anyone guide me around to linking a server to another in SQL Server 2008 R2? I am getting the following error when trying to do so in Management Studio. The linked server has been created but failed a connection test. Do you want to keep…
Jeff
  • 852
  • 7
  • 17
  • 28
10
votes
4 answers

Insert Data From One Server To Another?

If I want to run this sort of query in SQL Server, how can I do the same query from one server I am connected to to another? I tried adding "[ServerName1]." before "[DatabaseName1].[dbo]..." and "[ServerName2]." before "[DatabaseName2].[dbo]..." but…
sooprise
  • 22,657
  • 67
  • 188
  • 276
10
votes
3 answers

catastrophic failure trying to select from linked server

I have created a linked oledb/odbc connection to Pervasive SQL from SQL SERVER 2012: USE [master] GO /****** Object: LinkedServer [KSLAP208] Script Date: 2/8/2013 10:38:55 AM ******/ EXEC master.dbo.sp_addlinkedserver @server = N'KSLAP208',…
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
9
votes
3 answers

Openquery works much faster than a query straight to a linked table

Trying to figure out why there is such a significant difference between select * from linkedserver..tablename and select * from openquery(linkedserver, select * from tablename). 4 minutes vs 13 seconds.
Stephanie Page
  • 3,875
  • 1
  • 18
  • 22
9
votes
1 answer

Trying to call a T-SQL Stored Procedure which selects data from linked server in SSIS package

I have a scenario where I am trying to select some data in a table t1 & t2 from a remote Server (on which I just have read permissions) S1 in DB db1 from another remote Server(on which I am DBO but dont really have all the permissions so that I can…
vineela
  • 91
  • 1
  • 4
9
votes
4 answers

How to create linked server MySQL

Is it possible create/configure MySQL for functionality like SQL Server's Linked Server? If yes, would you please tell me how? I'm using MySQL 5.5.
Tioma
  • 2,120
  • 9
  • 35
  • 52
9
votes
1 answer

Linked Server In SQL Server Express

I am developing an app where i have a local database in SQL Server Express. During work in local database, we need to execute a query on another SQL Server / live server and its return a value and with this value we execute a query in local server.…
JSJ
  • 5,653
  • 3
  • 25
  • 32
9
votes
1 answer

Azure SQL Table -> SQL Server View -> Linked Access table: can't update

So I have this cute daisy chain: A Table in an Azure SQL Database (tblAzure) A View to tblAzure in a local SQL Server database (vwSQL) A linked table in Access pointing to vwSQL (tblAccess) Although parts work individually, I can't update the…