SQL Scripts Manager - 1.3
Worked example: adding a new script to SQL Scripts Manager
You can use SQL Scripts Manager to build a simple graphical user interface for any SQL, Powershell, or IronPython script.
To use one of your own scripts with SQL Scripts Manager:
- Locate your script code (for example, a T-SQL script), and make a copy.
You need to edit this copy to make it suitable for use with SQL Scripts Manager.
- Before you can use your script with SQL Scripts Manager, you must convert it into an .rgtool XML script file.
This involves wrapping your script code with appropriate XML elements and attributes, such that the resulting file is a valid SQL Scripts Manager XML file. You should also rename your script file to have an .rgtool extension.
Refer to The SQL Scripts Manager XML schema topic for detailed information about the format of .rgtool XML script files.
You will also need to define a graphical user interface (GUI) for your script. The GUI definition is part of the XML script file, and enables you to add controls for selecting a SQL Server instance or database, and to map other controls to parameters required by your script (such as text boxes and option buttons).
See Types of control for detailed information about specifying GUI controls.
Alternatively, you may find it easier to start with a copy of one of the .rgtool files provided with SQL Scripts Manager. To locate these files, select File > Show Scripts Folder from the main SQL Scripts Manager window.
- Once you've finished editing your new .rgtool file, save it to the SQL Scripts Manager scripts folder, located at \Documents and Settings\All Users\Application Data\Red Gate\SQL Scripts Manager\ by default.
- Start SQL Scripts Manager.
If your .rgtool file is valid, the script will be shown in the list on the main SQL Scripts Manager window, ready to run.
If there are problems with the file, it is associated with the '<Load Error>' tag, and the error is shown beneath the script title in the scripts list:

Note that SQL Scripts Manager load errors relate to problems with the XML structure of your .rgtool file.
Any syntax or logic errors in the script code (the code contained within the <script> tags in your .rgtool file), will not be evident until you run the script using SQL Scripts Manager.
Was this article helpful?
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Scripts Manager
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Using SQL Scripts Manager