Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    1

    Unanswered: select from multiple servers

    How to select data from multiple sql servers?

    i.e., I have two servers with sql 7 running both for different applications.
    Server A has a database db1 and server B has also DB1, with table1 and table2 as the table names.

    There are identical tables in both the servers.

    Now, I want to select data from server a, db1 and the table is table1 and also, in the same query want the data from server b, db1 and table1.

    Is it possible to select like this? if yes, how?

    sriram

  2. #2
    Join Date
    Oct 2003
    Location
    Manila, Philippines
    Posts
    20

    Re: select from multiple servers

    Originally posted by nsriram
    How to select data from multiple sql servers?

    i.e., I have two servers with sql 7 running both for different applications.
    Server A has a database db1 and server B has also DB1, with table1 and table2 as the table names.

    There are identical tables in both the servers.

    Now, I want to select data from server a, db1 and the table is table1 and also, in the same query want the data from server b, db1 and table1.

    Is it possible to select like this? if yes, how?

    sriram

    I cant tell you the full details but try to browse the previous threads...this is already answered from the previous topics.

    about a week ago...

    Syntax
    sp_addlinkedserver [ @server = ] 'server'
    [ , [ @srvproduct = ] 'product_name' ]
    [ , [ @provider = ] 'provider_name' ]
    [ , [ @datasrc = ] 'data_source' ]
    [ , [ @location = ] 'location' ]
    [ , [ @provstr = ] 'provider_string' ]
    [ , [ @catalog = ] 'catalog' ]

    SELECT *FROM [servername\instancename.]pubs.dbo.authors.

    so you can select from dif servers just like selecting from ordirary database tables


    -bernie

  3. #3
    Join Date
    Sep 2003
    Location
    Mumbai, India
    Posts
    36
    Link the servers. The use Union.

Posting Permissions

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