How to add muliple Linked servers in a single query

  • Hi I have created a list of servers in my domain... I m going to create Inventory tool...

    I am stuck at How do I add list of servers in domain(which I imported in a table using OSQL -L > filepath). Now how do add all servers in list in Linked servers.

    is it possible using sp_addlinkedserver to add multiple servers???

    Sagar Sonawane
    ** Every DBA has his day!!:cool:

  • You would need to loop over the rows in the table and execute sp_addlinkedserver for each one.

  • While you can do that I would absolutely NOT use linked servers to reach out to a bunch of servers to perform activities, I would use SSIS to do this.

    CEWII

  • I saw several posts about queries with Linked Servers and I thought I'd toss out another alternative if you have a SQL 2008 installation...Central Management Servers. I setup one with all my servers grouped by SQL version so I can run a simple query that executes against all servers or just groups of servers. This might be an alternative if you don't need those queries to be automated.

    How to: Create a Central Management Server & Server Group (SSMS)

    http://msdn.microsoft.com/en-us/library/bb934126.aspx

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

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