Andres
Andres

Reputation: 2899

Access linked server from linked server directly

I have two SQL Server instances:

In SQLSERVER32, I have a linked server to a Paradox database called ParadoxDBLinkedServer.

To access some of the Paradox tables in the server I just execute the following statement:

SELECT * 
FROM [ParadoxDBLinkedServer]...Clients

Then, I need to access to these objects from the SQLSERVER64 instance. In order to do so, I created a linked server called [.\SQLSERVER32] in this instance pointing to SQLSERVER32.

What I'm trying to do now is to access directly the ParadoxDBLinkedServer objects from the SQLSERVER64 instance. I mean, accessing a linked server from another linked server.

The query I´m trying to run is the following one:

SELECT * 
FROM [.\SQLSERVER32].[ParadoxDBLinkedServer ]...Clients

But I get this error:

The number name '.\SQLSERVER32.ParadoxDBLinkedServer ...Clients' contains more than the maximum number of prefixes. The maximum is 3.

Is there any way to perform an access like this? What am I missing here?

I'm trying to avoid creating a View for each table of the ParadoxDBLinkedServer in the SQLSERVER32 instance to reduce overhead.

Upvotes: 0

Views: 1587

Answers (2)

Weihui Guo
Weihui Guo

Reputation: 3997

This is late, but hopefully can be helpful to someone else who comes to this post later. If you can use openquery then something like this should work:

SELECT * FROM OPENQUERY([.\SQLSERVER32], 'SELECT * FROM   OPENQUERY([ParadoxDBLinkedServer ],''SELECT * FROM Clients'')' )

Upvotes: 1

user7229222
user7229222

Reputation:

select * from openquery (Linkedservername,'select * from tablename')

Upvotes: 0

Related Questions