Script - SQL
The SQL Script workflow object is used to execute SQL against the HelpMaster (or another) database.
This workflow object runs silently, meaning it has no user interaction. Silent workflow object are displayed with this icon.
Use
By default, any SQL script is executed against the HelpMaster database. To reference other databases, use the Use statement in your SQL, or construct your own database connection string within your SQL.
SQL Syntax should be Microsoft SQL Server only.
Use the Add Tag button to insert tags into your SQL script. These tags represent HelpMaster entity IDs that are within the context of the running workflow. If you require other information that is not accessible via the tags, consider expanding your SQL to look up this information based on the tags that you do have. Remember that you can also call stored procedures using this workflow object.
The following tags can be used in a SQL, or PowerShell script
- <<JobNumber>> : The job number that the workflow is running in
- <<ClientPKID>> : The primary client ID of the job that the workflow is running in
- <<SitePKID>> : The Site ID of the job that the workflow is running in
- <<AssetPKID>> : The primary asset ID of the job that the workflow is running in
- <<LoggedOnUserPKID>> : The User ID of the staff member that is currently logged in
Variables can also be used in the script. To insert a pre-defined variable, start typing double angular brackets "<<", and all of the available variables will be displayed in a pick-list. Choose the variable you want to inert as a place-holder. It's value will be substituted for the place-holder when the script is run.
Database and Security Warning!
Use this feature with care - running SQL queries has the potential to affect many rows and/or cause damage to your database. Ensure that all SQL is valid, and no malicious, or ruinous script is ever run against your HelpMaster database. This feature should only be configured by appropriate personnel who understand SQL and the HelpMaster database schema. An incorrectly generated SQL statement can do irreparable damage to your HelpMaster database.Limiting access to scripting features
All SQL/Scripting features within HelpMaster are governed by a security setting. Only staff members that belong to an Application Security Role that has this setting enabled will be able to use, modify and run scripts. See also Security Setting to enable/disable SQL.
See Also
Decision - Script / Data based
Execute Powershell as part of workflow
Control Powershell use via application security roles
System Administration
Security Setting to enable/disable SQL
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.