For those who aren’t aware, there’s a new Management Studio feature in SQL 2008 that allows you to run a query on several servers at once. And since a video is worth a thousand words, here’s a quick video that shows how it’s used:
Here’s what’s going on, I’ve got a registered group of servers. You can see in the video that the group is called “MSWART Instances”. The group contains registrations to two instances. One is to “MSWART\SQL2005” and one is to “MSWART\SQL2008”.
In the context menu, I selected “New Query”. Notice a few things. The (pink) status bar at the bottom says “Connected. (2/2)” and instead of the usual server name, I see the Server Group name “MSWART Instances”.
I ran a simple query and I got back a result set containing results of the query as they were run on each server. A column called ServerName was automatically prepended to the result set. The values in that column let me know which server returned a particular row.
I’ve already used it a few times at work. And the best part is that this feature doesn’t care which version of SQL Server it’s connecting to (Unlike some other features I could name).