Access linked server from linked server directly

1.5k views Asked by At

I have two SQL Server instances:

  • SQLSERVER64
  • SQLSERVER32

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.

2

There are 2 answers

0
AudioBubble On

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

0
Weihui Guo On

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'')' )