March 8, 2016 at 11:14 am
I know you can right click on the "Local Server Groups" in the Registered Servers panel and select "New Query" to run queries against all you registered servers. But is there any way to take an existing single server query and connect it to a second (or more) server?
March 8, 2016 at 1:55 pm
Not with SSMS. You can cange the connection of a query window, but the new connection will always be to a single server.
If you want to do that with multi-server queries, copy/paste the query from the single server query window to the multi-server query window or open the file once connected to the multi-server query window.
-- Gianluca Sartori
March 8, 2016 at 2:26 pm
spaghettidba (3/8/2016)
Not with SSMS. You can cange the connection of a query window, but the new connection will always be to a single server.If you want to do that with multi-server queries, copy/paste the query from the single server query window to the multi-server query window or open the file once connected to the multi-server query window.
Thanks for the reply. I thought it wasn't possible and what you suggest is what I do now. Just thought there might be some trick of the trade I was missing 🙂
March 9, 2016 at 1:01 pm
Siberian Khatru (3/8/2016)
spaghettidba (3/8/2016)
Not with SSMS. You can cange the connection of a query window, but the new connection will always be to a single server.If you want to do that with multi-server queries, copy/paste the query from the single server query window to the multi-server query window or open the file once connected to the multi-server query window.
Thanks for the reply. I thought it wasn't possible and what you suggest is what I do now. Just thought there might be some trick of the trade I was missing 🙂
The only trick of the trade I know (and use when needed) is to open a new query window, then copy/paste the query from the existing window. Ctrl-A / Ctrl-C / Tab / Ctrl-V. Four keystrokes, that's the fastest method I know of.
March 10, 2016 at 6:40 am
Allow me to say, actually, sort of. Depending on how hard you want to work.
You can use Linked Servers to run the query against multiple server connections, but you'll have multiple copies of the query in the same window each using a different linked server, or have to alter the query each time you run it to use the next linked server.
So, yeah, it is possible. Sort of.
March 10, 2016 at 10:54 am
Use the registered servers, and create a sub-group with only the couple of servers you want to run your query against. Right click the sub-group > new query.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply