Results 1 to 2 of 2

Thread: How to access a linked server's linked server in SQL Server

  1. How to access a linked server's linked server in SQL Server


    In Microsoft SQL Server, you can define remote data sources as "linked servers" and access them in a query using syntax that qualifies the object (e.g., table) name according to where it resides ... e.g., server.database.schema.object. However, sometimes, you may need to access a linked server's linked server.


    Unfortunately, SQL Server's query syntax doesn't give you a direct way to do this; you only have the four levels mentioned above. Furthermore, since a "linked server" is merely a configuration telling SQL Server how to access the remote data source, you can't really think of a linked server's linked server as if it were just an object on that database.


    However, there are ways you can access the remote linked servers. In particular, it's possible to use the openquery() command for executing pass-through queries to actually pass through another openquery() command that in turn passes through another query to the linked server's linked server. In this way, you can sort of chain linked servers together. This may be helpful for quickly getting information from the doubly remote server (such as may be needed for troubleshooting).


    Another approach is to have stored procedures that reference linked servers, which can be called from other servers. Of course, such solutions are liable to be slow, so some sort of synchronization/ETL/caching approach may work better if you have a long-term need to get data from remote servers.


    Finally, you may decide to simply set up all linked servers directly. Hence, for three databases that need to access each other, each one would have two linked servers to access the other two.

    Mubasshar


  2. Re: How to access a linked server's linked server in SQL Server

    nice news.

Similar Threads

  1. 66 Saal - Tahir Server Mir - 23rd October 2013
    By Realpaki in forum Newspaper Columns | Editorials | Opinions
    Replies: 0
    Last Post: 23rd October 2013, 10:06 AM
  2. Sadhu Ka Khawab - Tahir Server Mir - 22nd October 2013
    By Realpaki in forum Newspaper Columns | Editorials | Opinions
    Replies: 0
    Last Post: 22nd October 2013, 09:33 AM
  3. HU HU HAHA - Tahir Server Mir - 16th October 2013
    By Realpaki in forum Newspaper Columns | Editorials | Opinions
    Replies: 0
    Last Post: 16th October 2013, 11:20 AM
  4. RIM launches BlackBerry Enterprise Server service
    By mubasshar in forum Techno Corner
    Replies: 0
    Last Post: 11th August 2012, 12:57 PM
  5. Track Changes in Windows Server 2003 and higher
    By mubasshar in forum Techno Corner
    Replies: 0
    Last Post: 20th April 2010, 01:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •