T-SQL to get data from 10 different Linked Servers.

  • Hi Folks,

    We have 10 different servers.

    Each server has the same set tables. Now we need to collect data of say 2 tables from each server to a new server.

    What is best way to do this acitivity.

    We have created linked servers from the new server to each server.

    Any suggestion will help.

    Thanks.

  • If I understand correcly, I normally run a query like this assum that I already linked the servers:

    select * from tablea

    union

    select * from [111.11.1.1].db_name.dbo.tablea

    union

    select * from [111.11.1.2].db_name.dbo.tablea

    union

    select * from [111.11.1.3].db_name.dbo.tablea

    union

    select * from [111.11.1.4].db_name.dbo.tablea

    and etc...

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

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