Chat now with support
Chat with Support

Toad for SQL Server 7.4.1 - Installation Guide

Automation Script Troubleshooting and Error-Handling

This topic contain information to help you troubleshoot Automation script execution issues. It also includes tips for manipulating errors and using error messages.

Troubleshooting Tips

For issues related specifically to scheduled scripts, see the following:

Review the following general Automation script issues.

Issue Description and Resolution
Variable contains backslash (\) When a variable value is drawn from database data which includes the backslash (\) character, you must explicitly escape each backslash.

Error-Handling Techniques

Activity Result Variable

Toad generates an internal variable that captures execution exceptions. The variable's name is _ACTIVITY_RESULT. This variable is assigned a value after the execution of each activity in a script. The value is based on the result of the activity execution and overwrites the previous value generated by the previous activity. This variable can be used to debug Automation scripts.

The following values are automatically assigned to the _ACTIVITY_RESULT variable based on the activity execution result.

Execution Result (Activity) Variable Value
Normal execution with no errors

If the activity executes normally and no errors are generated, the value "Succeeded" is assigned to the variable.

Tip: Because the previous value (if any) is overwritten by a successful activity, to preserve a previously-generated error message, assign the value to a new user-defined variable.

Error during execution

If an error is generated during activity execution, the error message is assigned to the variable. One of the following formats is used:

<exception message>

<exception message>; Inner exception: <inner exception message>

Using the _ACTIVITY_RESULT variable

  • You can use the _ACTIVITY_RESULT variable the same way you use any other built-in or user-defined variable in an Automation script. See Using Variables in Automation for more information.
  • To express the value of the variable, surround the variable name with hash symbols (#), for example #_ACTIVITY_RESULT#.

Suppress Script Failure

If necessary, you can prevent an error in one activity from causing a failure at the script level. This is useful if the logic of your script permits an error as part of the normal script workflow and execution, but you do not want it to result in an overall script failure.

This action does not suppress error messages.

To suppress script failure

  1. With the script open in the Automation design window, select the activity in which you want to suppress script failure.
  2. On the Activity Info tab, clear the Generate Error check box.

    If the Stop On Error option is selected for the entire script (Settings), you must clear the Stop on Error check box for the individual activity before you can clear the Generate Error check box.

 

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating