SQL Script Tab

This tab allows you to configure the selected SQL script.

Sql script

SQL Script Execution Sequence

The SQL scripts of an SQL connection are executed in the order they appear in the tree (top-down). To change the execution order, move them by drag and drop in the tree.

Execution

Run SQL Script

Select when the SQL script should be executed. You have three options:

  • At install
  • During maintenance (repair or modify)
  • At uninstall
  • During rollback

Warning!The changes made by an SQL Script on a database cannot be undone. Uninstall won't rollback the changes performed by the SQL statements. You will need to supply, if necessary, SQL scripts scheduled to run at uninstall or rollback that will undo changes made by the scripts ran during install.

Script Condition

Condition the script's execution. Edit this field using Smart Condition Edit Control.

TipIf none of the SQL scripts assigned to an SQL connection is to be executed due to their condition or scheduling, that SQL connection will not be triggered.

In case of error

Specify the action that should be taken if an SQL script error is encountered when the script is executed.

NoteIf you choose to go to the SQL script file's next statement in case of script execution error you will need to supply a statement separator for the SQL script.

SQL

Script File

Specify the script file. Use [ ... ] button to select it.

Script Inline

Use the embedded editor to instantly create a script inline on the fly.

Statement separator (SQL Batch file separator)

Specify the separator for the SQL statements.

ImportantBy default this field is empty; if you supply a statement separator (Eg. semicolon ; or GO ), during installation the SQL script batch file will be automatically split into component statements using the supplied statement separator and each SQL statement will be executed individually. Otherwise, SQL script will be executed as a whole. Format: with the exception of semicolon ; , the statement separator must always begin with a letter and can contain only alpha-numeric characters.

NoteSome Database Servers do not permit executing multiple statements at once. In this case supply a statement separator to indicate that the SQL queries should be executed individually. For more information please read Why does my SQL Script fail to run when executed from the installer? FAQ.

Strip comments from SQL script

Removes all comments from the SQL script. (This option also removes SQL comments from your stored procedures, if any.)

Disclaimer

ImportantMake sure the SQL code you supply is well-tested before deployment. If errors occur during installation, the changes cannot be undone. This functionality assumes familiarity with SQL syntax. Advanced Installer Technical Support does not provide assistance with debugging SQL statements.