tags:

views:

422

answers:

5

Is there a simple way in, say Microsoft SQL Server Management Studio to run a saved .sql script on a list of databases?

A: 

No. .

tsilb
+1  A: 

You could execute the script against multiple databases using a batch file to execute the script using SQLCMD

cmsjr
A: 

http://www.ssmstoolspack.com/

A: 

Yout didn't specify what version, but this is also supported natively in SQL 2008 Management Studio by right clicking on a server group in the Registered Servers window and selecting "New Query". This works against pervious version of SQL as well and mixed groups (e.g. SQL 2000, 2005 and 2008 all at once).

Red-Gate also has a tool you can purchase that does this called SQL Multi Script: http://www.red-gate.com/products/SQL_Multi_Script/index.htm. I've never used it though.

A: 

This always has been a big hassle for us. We have been looking for a tool to do exactly this. We tried both www.redgate.com and www.queryblaster.com. We decided to go with queryblaster, it was the easiest to use out of the two. Both of these software applications allow you to run scripts on multiple databases at once.