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
6
votes
2 answers

SQL Servers: Linked-servers without linking servers?

Both my local (and remote) SQL SERVER 2005 administrators claim that "allowing linked-servers is a security issue" and forbid their use here. (Huh?) Anyway, is there a way to do something similar WITHOUT linked-servers? SELECT * FROM…
HelenJ
  • 139
  • 2
  • 5
6
votes
2 answers

Test if Table Exists in Linked Server (Server Name is a Parameter)

I need to test if a table exists in a linked server, where linked server is a parameter (it has to be), that's why I'm using exec method. I tried many ways but I didn't succeed. Declare @LinkedServerName varchar(50) Declare @DS varchar(50) Declare…
Saleem
  • 709
  • 2
  • 13
  • 34
6
votes
1 answer

sql linked server join query

I am having issues running any query on joining a local DB with a DB from a linked server. My query: SELECT [LocalDatabase].[dbo].[Record].[Project_ID], [LinkedServer].[Reporting].[dbo].[Active].[Name] FROM…
sd_dracula
  • 3,796
  • 28
  • 87
  • 158
6
votes
1 answer

How to link from Postgresql to SQL Server via ODBC?

I need to be able to query a SQL Server database from within Postgresql. The Postgres instance is running locally and the SQL server set up as an ODBC data source. How do I add this as a linked server? Is there a better approach? Thanks
ZeroEric
  • 371
  • 1
  • 4
  • 7
6
votes
3 answers

SQL Azure as a linked server -> get identity of inserted row

I've set up our Azure cloud DB to be a linked server to our 'SQL server 2008 R2'-server like this post described: http://blogs.msdn.com/b/sqlcat/archive/2011/03/08/linked-servers-to-sql-azure.aspx I've enabled RPC and RPC Out because I read that…
Zenuka
  • 3,110
  • 28
  • 39
6
votes
1 answer

Unable to begin a distributed transaction: Linked Server -> Access database

Specs: Sql Server 2008 Server 2008 R2 64bit MS Access database What works: I have configured a Linked server connection to the Access database by installing office access data components and creating a system DSN and whatnot. which resides in a…
Danthar
  • 1,068
  • 7
  • 13
5
votes
2 answers

SQL Server Linked Server query running out of memory

I have a DBF file on a network share that I'm trying to select into a SQL Server table. This query: SELECT * FROM OPENQUERY(MyLinkedServer, 'SELECT * FROM DP') ... throws this error: OLE DB provider "MSDASQL" for linked server "MyLinkedServer"…
Laran Evans
  • 1,283
  • 5
  • 15
  • 31
5
votes
2 answers

How to prevent an Insert query from enrolling into a Distributed Transaction?

I have a SQL Insert query inside a stored proc, for inserting rows into a linked server table. Since the stored proc is getting called within a parent transaction, this Insert statement tries to use a DTC for inserting rows into the linked server. I…
Gulzar Nazim
  • 51,744
  • 26
  • 128
  • 170
5
votes
3 answers

How to add an IBM DB2 server to SQL Server's Linked Server

From .Net, I'm able to connect to the DB2 database: First I include a reference to "IBM.Data.DB2.iSeries" Then I create a new IBM.Data.DB2.iSeries.iDB2Connection. The connection string…
Allan W
  • 580
  • 1
  • 3
  • 8
5
votes
1 answer

MSSQL: Transaction Isolation Level with Linked Server

I'm using an MS SQL database that is written/read constantly, as well as the databases that it is linked to through Linked Server connection. This is why I'm using SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED in every query that I'm running. My…
Alexandr Kapshuk
  • 1,380
  • 2
  • 13
  • 29
5
votes
3 answers

Can you have a Foreign Key onto a View of a Linked Server table in SQLServer 2k5?

I have a SQLServer with a linked server onto another database somewhere else. I have created a view on that linked server create view vw_foo as select [id], [name] from LINKEDSERVER.RemoteDatabase.dbo.tbl_bar I'd like to to the following alter…
d4nt
  • 15,475
  • 9
  • 42
  • 51
5
votes
1 answer

Can you view linked server properties in MS SQL server Management Studio without dropping server?

Why do you have to drop a linked server before you can make changes to the server? Why can you not view properties of the server i.e. username access rights etc? Is it practical to drop a table first before having the ability to alter it and make…
Coded Container
  • 863
  • 2
  • 12
  • 33
5
votes
1 answer

SQL Server How to add a linked server to the same instance without performance impact

in my company, we have several environments with MS SQL database servers (SQL 2008 R2, SQL 2014). For the sake of simplicity, let us consider just a TEST environment and a PROD environment and two sql servers in each. Let the servers be called…
Pavel Foltyn
  • 175
  • 3
  • 13
5
votes
3 answers

MSSQL Linked Server error: The OLE DB provider "OraOLEDB.Oracle" for linked server supplied inconsistent metadata for a column

I was trying to pull data from Oracle to MSSqlserver database using Linked server. select * from [LINK_NAME]..SCHEMA.TABLE; But it was failing with the below error: The OLE DB provider "OraOLEDB.Oracle" for linked server "LINK_NAME" supplied…
Deepak
  • 81
  • 1
  • 1
  • 10
5
votes
4 answers

Login failed when querying linked server

I am trying to create a linked server in SQL Server: --Create the link to server "uranium" EXEC master.dbo.sp_addlinkedserver @server = N'uranium', @srvproduct=N'', @provider=N'SQLNCLI' --Add the catch-all login with SQL Server…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219