Joining against a Linked Server

  • Hi all,

    We have a linked server which we need to query. This works fine as a linked server (SQL2000). I need to join in data from the Linked Server to pricing information on our Local Server.

    So far, I have been using two methods to query the data in the HQ Office.

    SELECT *

    FROM <SERVER>.<DB>.<DBO>.<TABLE>

    And...

    SELECT *

    FROM OPENQUERY(<LINKED SERVER>, 'SELECT * FROM <DB>.<DBO>.<TABLE>')

    I cannot see how to join in data from a local database.

    Any idea's? Is this possible?

    I have asked whether we could avoid this route by just replicating the data (as we will have users accessing this data daily) but they are reluctant.!

    Any help is much appriciated.

    Thanks,

    Clive

    Clive Strong

    clive.strong@btinternet.com

  • Either way just add you join and the db.schema.table to join.

    Ex

    SELECT *

    FROM <SERVER>.<DB>.<DBO>.<TABLE>

    INNER JOIN

    <LOCALDB>.<DBO>.<TABLE>

    ON

    THIS = THAT

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply