Aleks
asked on
Can I run one script in multiple sql databases at once ?
I have a server with over 50 databases, they are all exactly the same, for liability reasons we need to keep them separate. Every week or so I need to run a script to update them, it is the same script for all 50 databases.
Is there a way to run the script ONCE and have it update ALL selected databases ? It is a pain to have to run it 50 times.
I am using MS SQL 2008 RC2.
Is there a way to run the script ONCE and have it update ALL selected databases ? It is a pain to have to run it 50 times.
I am using MS SQL 2008 RC2.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can avoid that database in this line
WHERE name NOT IN ('master','model','msdb',' tempdb')
WHERE name NOT IN ('master','model','msdb','
ASKER
Thanks .. I actually found the perfect tool. RedGate has 'multi script', allows to run scripts in multiple databases and actually multiple sql servers as well. Will make managing the lists of databases easier !
Thanks though !
A
Thanks though !
A
ASKER
There are a few databases there that are not related to this one particular service and those need to remain untouched.