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
5
votes
3 answers

Insert into table on the Linked Server with data from local table

I'm working with SQL Server Express, I created a linked server to an Oracle database. As the title indicates, I want to insert data selected from a local table into a table at the Linked Server. I tried many queries but no one of them worked as I…
Meher Jebali
  • 199
  • 2
  • 3
  • 18
5
votes
2 answers

Linked Server failing on SQL Server job

I have a linked server that perfectly works when executing a query. But when I place the query in a job, it fails. Here is the setting of my linked server Error
Philip Morris
  • 459
  • 1
  • 9
  • 26
5
votes
2 answers

executing an oracle stored procedure from Sql Server 2008

Im trying to execute an oracle stored procedure from SQL Server 2008 R8 trough DB LINK , the header of the stored procedure is like this : PROCEDURE TEST(X OUT NOCOPY VARCHAR2,Y OUT NOCOPY NUMBER,Z IN NUMBER ) This procedure will should…
aminedev
  • 323
  • 3
  • 9
  • 22
5
votes
1 answer

Untrusted security context in signed activated procedure

I have an activated procedure for a service broker queue that queries a linked server. I have signed the procedure using the method found here. However, I continuously see the following message in the sql server logs: The activated proc…
5
votes
2 answers

Call a Sproc on another SQL Server without being linked via TSQL

I want to call a sproc on server B from server A in TSQL without linking the servers. Is it possible to use something like a connection string to execute this sproc? The return will be a single nvarchar value. Regards.
Keith Adler
  • 20,880
  • 28
  • 119
  • 189
5
votes
2 answers

How do I truncate a table via linked server using a synonym for the table name?

I know I can do the following: EXEC Server_Name.DBName.sys.sp_executesql N'TRUNCATE TABLE dbo.table_name' But what if I want to use a synonym for the table? I'm on SERVER1 and I want to truncate a table on SERVER2 using a synonym for the table…
JJ.
  • 9,580
  • 37
  • 116
  • 189
5
votes
2 answers

SQL to Oracle Linked Server Openquery retrieves single row

I was using OpenQuery To get row set from Oracle table into my SQL Server. Then i find there is something known as OPENROWSET to fetch all rows but it didnt worked for me. SELECT a.* FROM OPENROWSET('MSDASQL', 'DRIVER={SQL…
Shaggy
  • 5,422
  • 28
  • 98
  • 163
5
votes
2 answers

Two queries. Same Output. One takes 2 hours and the other 0 seconds. Why?

I have some IDs inserted into a temp table #A as follows: SELECT DISTINCT ID INTO #A FROM LocalDB.dbo.LocalTable1 WHERE ID NOT IN (SELECT DISTINCT ID FROM LocalDB.dbo.LocalTable2) GO CREATE INDEX TT ON #A(ID) GO I am trying to obtain some…
Legend
  • 113,822
  • 119
  • 272
  • 400
5
votes
2 answers

How to test linkedserver's connectivity in TSQL

I need to write a procedure to collect data from several remote servers, I use linkedservers and OPENQUERY to gather data from servers, but sometimes I lose connection to some servers or I simply can't connect them (e.g. remote server is offline)-…
dogant
  • 1,376
  • 1
  • 10
  • 23
4
votes
1 answer

In SQL server, how can I query an Oracle Timestamp column over a Linked server connection?

The query I have made in oracle does not work with linked server with sql server 2008. The OLE DB provider "MSDAORA" for linked server "ORACLE" supplied invalid metadata for column "DATETIME_INS". The data type is not supported. The…
kinkajou
  • 3,664
  • 25
  • 75
  • 128
4
votes
2 answers

Update MySql from MS SQL server

I need help in writing queries which will update MySql tables from SQL server. I have created linked server and select queries work fine but I'm getting errors while doing update. I'm really new to writing such type of queries so please help me…
pramodtech
  • 6,300
  • 18
  • 72
  • 111
4
votes
2 answers

"ASP.NET" error: Access to the remote server is denied because no login-mapping exists

I'm able to execute a stored procedure which queries a Linked Server directly, but when I call the same sproc though ASP.NET then I get the following error: Access to the remote server is denied because no login-mapping exists. When I execute it…
Even Mien
  • 44,393
  • 43
  • 115
  • 119
4
votes
0 answers

Performance implications for using OPENQUERY in a view

I am using an EasySoft ODBC driver to link a SQL Server 2008 R2 Express instance to Interbase and I am having some difficulty with getting metadata from the remote server. From looking about on the net the main sugestions all mention using OPENQUERY…
Rich Andrews
  • 4,168
  • 3
  • 35
  • 48
4
votes
4 answers

Best practices for managing migrations that update several databases?

My team is evaluating tools and processes for managing database migrations/database refactoring as described by Martin Fowler, Pramod Sadalage, et. al. We're interested in automated, repeatable, testable processes, so we're not interested in…
4
votes
5 answers

How to make WHERE clause case insensitive: From SQL Server querying Oracle linked server

We have a MS SQL Server 2005 installation that connects to an Oracle database through a linked server connection. Lots of SELECT statements are being performed through a series of OPENQUERY() commands. The WHERE clause in the majority of these…
Peter Bridger
  • 9,123
  • 14
  • 57
  • 89