SQL skript return value

Got a problem you cannot solve? Try here.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Re: SQL skript return value

Postby MichaelNesmith » Thu Jun 17, 2010 9:37 pm

As described in the help file topic titled MS SQL Server:

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.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 28 guests