Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Scenario

I have 4 front-end sql server.

All of them have the same db instances. Data are replicated from back-end databases.

Issue

In SQL Management Studio I have registered the servers and I have created a group (called front_end). The group can be inquired using the sql editor opening a connection to the servers group.

Is it possible to inquire the group programmatically setting the USE clause?

E.g.:

    use [front-end]..myDatabaseInstance
    select * from myTable
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

If you right click the registered servers group and select "New Query" you get a query window that connects to all the servers, whatever you execute will run on all and return combined results.

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

If you want to programatically do it, you can use a central management server and query that for a list of servers, and use linked servers to run the query at each location using openquery

http://sqltidbits.com/scripts/query-central-management-server-list

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.