December 13, 2012 at 4:55 pm
HI,
I have this code below and I have 4 instance of sql. How can I execute this code below for each instance without having to open 4 different mgt studio query connections for each instance to see the results? Appreciate the help.
exec sp_MSforeachdb '
use ?
select * from table1 '
December 13, 2012 at 9:40 pm
Try to use Central Management Server.
http://msdn.microsoft.com/en-us/library/bb934126(v=sql.105).aspx
December 13, 2012 at 10:59 pm
Two ways to do this are
1. to use exec MS_FOReachDB
2. to use cetnral management server.
December 14, 2012 at 3:34 am
Or create yourself a Local Server Group in the Registered Servers tab in SSMS, this allows you to run multi-server queries in one window.
December 14, 2012 at 10:31 am
awesome thank you everybody! soon as i posted this i found it online. central management servers did the trick! awesome stuff!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply