Linking databases from Different servers

  • I have 2 server is ‘server1 IP = 192.114.0.1’ and ‘server2 IP = 192.114.0.2’

    I have a table 'TableS1' in 'ServerA' and a table 'TableS2' in 'ServerB'

    I need to link 2 tables TableS1 and TablesS2 in a query.

    Please help.

    Regards,

    may

  • did you create linked servers to them yet?

    once the link exists, it's nothing more than referencing them with a 4 part name:

    SELECT * FROM LinkedServerA.databasename.dbo.TableA myAlias1

    LEFT OUTER JOIN

    LinkedServerB.otherdatabase.dbo.TableB myAlias2

    ON myAlias1.Id = myAlias2.ID

    WHERE myAlias2.SOMETHING ='aValue'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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