Return result in variable
Indicates the variable to hold the result of the script execution. If specified, this variable must have been previously defined in the setup script using the Set Variable command.
The variable will hold one of the following values, or a custom error message as described below:
SUCCESS: Connection to the database succeeded. The script executed successfully, or there were some script execution errors and Abort Execution on Script Error was not checked.
CONNECT_ERROR: Connection to the server failed.
CONNECT_DATABASE_ERROR: Connection to the database failed.
ERROR: An unknown error occured.
In addition to the values in the table above, when Abort Execution on Script Error is checked, and an error occurs during script execution (where database and server connections succeeded), this variable holds detailed error information as follows: The variable is split into two parts, delineated by the string literal DELINEATOR. The first part of the variable holds the exact textual error message. The second part of the variable holds the exact SQL script fragment where execution errors occured. You may parse the variable using the Parse String function to extract both fields and utilize them separately.
So, it would appear you can only get detailed execution results if an error has occurred.