Worked example - running a script and saving the results
Published 02 February 2017
In this example, we'll run the Version and uptime for an instance script, and save the results to a file.
The Version and uptime for an instance script is provided with SQL Scripts Manager along with more than 25 other scripts written by recognized SQL Server experts. You can read more about each script in the Scripts reference.
Run the script and save the results
- Start SQL Scripts Manager if it is not already running.
The right-hand pane shows all the available scripts, and the left-hand pane lists the tags and author names that are associated with the scripts.
Select a tag or author name to display only the matching scripts.
- Scroll to the bottom of the list and locate the Version and uptime for an instance script.
This script, and all the other scripts, include:
- An Open button: displays the script's form (GUI); this is where you select an instance/database, and set any parameters required by the script
- A Script details link: displays the Details dialog for the script; this includes a description, the source code for the script (SQL, IronPython, SMO, or Powershell), and information about the author
- A Preset list: contains previously saved settings for each script
- Click Open.
If this is the first time you have run this script on the local computer, the Details dialog is displayed, along with a warning message to check whether you have considered the implications of running the script. (If you have already run this script on the local computer, the Run dialog is displayed.)
Once you have reviewed the information on the Description tab, click Continue to proceed to the Run dialog box.
- On the Server drop-down list, select the SQL Server instance you want to check.
- Select the relevant authentication details, and type your User name and Password if required.
- Click Run.
The Results dialog box is displayed, and SQL Scripts Manager runs the Version and uptime for an instance script.
- When the script has finished running (shown by the 'Success' message), click Export to CSV to open a file browser, then type or select a file name that will store the results, and click Save.
The script results are now saved in comma separated value (CSV) format.
- Click Close to return to the main SQL Scripts Manager window.