Jul 19, 2017 5:37:00 PM by Mathew Phan
Hi follow Toadies!
As a SQL Server administrator you're likely managing dozens if not hundreds of databases. It's extremely time consuming to run a script on each and every one of those databases and then check the results. To make things even trickier, maybe you want to run a script on only some instances but not others.
For example, let's say you're looking for a server job but you don't know what server it's on. You'll probably go through and connect to each system, then query each one, and look for that job.
Toad for SQL Server has a slick Group Execute function that lets you target what instances you want to run your query against. You click the run button once, and Toad will connect to each instance and run your script then aggregate the results.
In this example, I'm connected an instance called WIN7 and I have an Editor window open.
If I go to the menu Editor > Windows and make sure Group Execute is checked on. This enables the embedded Group Execute tab within the Editor window.
If I click on this tab, then check the box "Enable", it puts my Editor in a Group Execute Mode. I can check multiple connections I want a script to be executed against from the Editor window.
Now back in the Editor window. I have a script here that lists the Scheduled Jobs on the instance. I click the execute button and it will run this script against all the connections I checked on the previous step. It displays the results for both executions at the bottom.
How awesome is that? If I had to check hundreds of instances it would save me a ton of time.
Go back to the Group Execute tab and you'll see a notification if the script ran successfully. You can toggle the mode on and off by unchecking the Enable box. If you want, you can group connections into custom folders through the right click menu. That way you can check off groups of SQL Server instances at a time, like I'm doing for my Development servers.
By the way, this Group Execute feature is also available in Toad for DB2 and Toad for SAP Databases.
Until next time, Toadies!
Tags: Toad for SQL Server
Written by Mathew Phan
Mathew Phan began his career as a technical support engineer for Toad for Oracle soon after graduating from the University of California, Irvine, where he obtained a bachelor's degree in computer and information science. Mat has devoted his entire 14-year career with the Toad family of database solutions and held various positions helping to shape the direction and growth of Toad. Early in his tenure, his focus was on Oracle databases from a developer point of view. Now as a systems consultant, he continues to work with customers to build effective solutions that meet their needs.