HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Managing multiple SQL Server databases

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
managingdatabasessqlmultipleserver

Problem

My company has many branch offices and each branch has a DB server. Some have SQL Server 2005 and some others have SQL Server 2008. The schema is the same for all these servers.

Whenever I want to do DDL like adding column, etc., I do it either by connecting to each server one by one, or by running the DDL script with OSQL through a batch file.

Is there a built in tool to do DDL at once on several servers? How about third party tools? (preferably free ones)

Solution

One approach:

In Management Studio 2008 R2, you can add your servers into groups called Registered Servers. I have groups for prod, dev, Prod-SQL2000 etc. You start this by going View - Registered Servers, and then adding them one by one (you can share with colleagues by exporting them)

This will then allow you to click on one of your groups (eg Prod), and selecting New Query..... Management Studio will then connect to all the SQL Servers in that group, and you can issue a query across all of them in that group. I personally do read only operations, as changing a number of servers at the same time is more risky.

Context

StackExchange Database Administrators Q#3913, answer score: 11

Revisions (0)

No revisions yet.