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

Not sure how to capture the results of this query

I have the following query I'm executing against a remote SQL Server: EXEC LinkedServer.MyDatabase..sp_executesql N'SELECT sys.fn_cdc_get_min_lsn(''dbo_td_coater_rga_new'');'; The query works fine, but I'm not sure how to capture the results of the…
Hosea146
  • 7,412
  • 21
  • 60
  • 81
0
votes
1 answer

What does SSMS use to create a linked SQL Server by name?

We have several SQL servers set up in my workplace that are all linked to each other and we make use of 4-part DB names in a lot of our code. We are considering moving some of our databases from one server to another and are assessing the impact on…
LegendaryDude
  • 562
  • 8
  • 23
0
votes
1 answer

How to execute reports which involve a stored procedure calling out to a linked server

I wrote a stored procedure that calls openquery to a linked server to get data from a remote postgresql server and fill a table with that data. This is working fine. The stored procedure needs 3 parameters. When I try to call the stored procedure…
Capanga
  • 77
  • 1
  • 8
0
votes
0 answers

Using distinct keyword returns invalid rows in linked server

I am getting some strange results from a query in SQL server that I can't work out. The query is select ref5 from t_wholesale_history left outer join AP21..AP21.REFTBL on reftbl.tblname = 'SOrder' and reftbl.rg_ord = 5 …
Lock
  • 5,422
  • 14
  • 66
  • 113
0
votes
2 answers

Problem running DELETE statement against linked server in SQL Server 2008

I'm having a problem running this query: DELETE FROM [IRPROD]..[BUDGET_USER].[GL_EXP] WHERE FISCAL_YEAR = 2010 IRPROD is a linked server to an Oracle 10g database. It's linked using the Oracle OleDB provider. There are ~79000 records that need to…
Clint Davis
  • 451
  • 1
  • 12
  • 29
0
votes
1 answer

Sql server Linked server query error

I am using a big stored procedure which is using many linked server queries. If i run this stored procedure manually it runs fine but if i call this stored procedure with exe using mufti-threading, it is raising "Cannot get the data of the row from…
Ravi
  • 310
  • 3
  • 11
0
votes
1 answer

Setup a linked server connection from Microsoft SQL Server Management Studio to a MySQL Amazon Web Services MySQL RDS?

I want to add a MySQL instances that is running as a RDS service through Amazon Web Services as a Linked Server in Microsoft SQL Server Management Studio. Does anyone know of any information on how I can set this up? What I want to be able to do is…
user802599
  • 787
  • 2
  • 12
  • 35
0
votes
0 answers

SQL Query to linked server just keeps on running

I have a SQL Server 2008 R2 server and a *.dbf file that I would like to import into SQL Server. When I tested this on my dev machine I am able to query the .dbf file and import the data but for some reason when I try set this up on the remote site,…
Stephen
  • 11
  • 3
0
votes
1 answer

SQL Server: Query not linked server providing credencials. Is possible?

I tried to query another specific server many times, but i failed... I searched and i found out that the server must be linked with the other server in order to achieve what i want. Unfortunately is not in my hands to change that so my question is,…
CodeArtist
  • 5,534
  • 8
  • 40
  • 65
0
votes
1 answer

Performance issue while Querying the oracle database using linked server

I am connecting the oracle db server from sqlserver 2005 using linked server with microsoft oledb oracle drivers. Table present in the oracle db is having the DateTime Stamp. So i will be fetching only the latest records from that table, by passing…
raj
  • 91
  • 1
  • 1
  • 4
0
votes
0 answers

Executing a Stored Procedure on a Linked Server

I am running SQL Server 2012 on two separate servers (let's call them Server A and Server B). On Server A, I have created a linked server to Server B called [ServerB]. I am able to query Server B from Server A without any problems: SELECT *…
HydroPowerDeveloper
  • 3,302
  • 7
  • 31
  • 38
0
votes
0 answers

Executing stored procedure in Linked server inserts junk chars in null field

I am executing a stored procedure in a linked server using sp_executesql if any one the parameters is null then, it updates with some junk chars can anyone point me in right direction to resolve this. we are executing the below command inside SQL…
karthickj25
  • 1,207
  • 9
  • 16
0
votes
1 answer

Alias name for database

I have a scenario to use Alias name to access database from SP, and I would like to know if there is any method to achieve this in SQL Server. Since Linked Servers only allows Server objects and SYNONYM only allow object inside the database.
0
votes
0 answers

How to replicate data between tables on linked servers?

Good Day I have created a linked server on my SQL Server to my MySQL Database. The SQL Server Database is Called Main and the Table I am looking at is called ORDR. The MySQL Linked server connection is called MySQL_Link and the table I use in there…
Ruan du Preez
  • 91
  • 1
  • 3
  • 12
0
votes
0 answers

SQL server UPDATE OPENQUERY

I am trying to link two servers (the host is SQL Server 2008 and the destination is ORACLE) so that a table on the oracle server is populated by data held in multiple tables on the SQL server. I have set up an INSERT OPENQUERY, which works perfectly…
ChrisG
  • 11
  • 5