SQL Query TabCopy link to this sectionLink to this section copied!

This tab allows you to configure the selected SQL query.

ExecutionCopy link to this sectionLink to this section copied!

Set the execution options for the SQL query.

Schedule Action to Run SQL QueryCopy link to this sectionLink to this section copied!

The SQL query can be triggered by scheduling the associated custom action in the install execution stage or by directly invoking the custom action with a published event.

Abort installation in case of errorCopy link to this sectionLink to this section copied!

Abort the installation if an error is encountered during query execution.

NoteYou can suppress the spawned message box for the SQL query operation by setting the SqlSuppressSpawnMsgBox property to 1. You can set this property statically (from Install Parameters) or dynamically (from the installer UI - associated with an Edit Control or with a Set installer property value Initialization/Published Event).

Data BindingCopy link to this sectionLink to this section copied!

This section allows you to configure data bindings for your SQL query.

Adding a new data bindingCopy link to this sectionLink to this section copied!

Use the [ New... ] button, the “New...” context menu item or press the Insert key while the list control is focused.

Moving a data bindingCopy link to this sectionLink to this section copied!

Use the [ Up ], [ Down ] buttons, the “Up”, “Down” context menu items or press the Page Up, Page Down keys while the list control is focused.

NoteThe top-bottom order of the data bindings is important because it will represent the left-right columns order in the result set.

Removing a data bindingCopy link to this sectionLink to this section copied!

Use the [ Remove ] button, the “Remove” context menu item or press the Delete key while an element from the list control is focused.

ResultsCopy link to this sectionLink to this section copied!

The specified binding properties will be used by Advanced Installer to return the result set values:

  • any ComboBox control that has the above specified properties associated with it.
  • any ListBox control that has the above specified properties associated with it.
  • the first row from the result set will be bound directly to the above specified properties.

TipFor an example on how data bindings are set in an SQL query follow SQL Query Examples.

SQLCopy link to this sectionLink to this section copied!

Script FileCopy link to this sectionLink to this section copied!

Specify the file for the query. Use [ ... ] button to select it.

Script InlineCopy link to this sectionLink to this section copied!

Use the embedded editor to instantly create a query on the fly.

Statement separator (SQL Batch file separator)Copy link to this sectionLink to this section copied!

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 scriptCopy link to this sectionLink to this section copied!

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

DisclaimerCopy link to this sectionLink to this section copied!

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.

SQL Query ExamplesCopy link to this sectionLink to this section copied!

The SQL Query result sets can be either generic (multiple rows, multiple columns), vertical (multiple rows, 1 column) or horizontal (1 row, multiple columns).

Generic exampleCopy link to this sectionLink to this section copied!

Assuming the following binding properties set for the SQL query:

Data Binding

The data binding set should match the query result set so in this case, we'll have the following result set:

COL_ACOL_BCOL_C
ROW_1VAL_1AVAL_1BVAL_1C
ROW_2VAL_2AVAL_2BVAL_2C
ROW_3VAL_3AVAL_3BVAL_3C

ResultsCopy link to this sectionLink to this section copied!

  • any ListBox or ComboBox controls that have the associated property named COL_A_PROP will be populated with VAL_1A, VAL_2A, VAL_3A.
  • any ListBox or ComboBox controls that have the associated property named COL_B_PROP will be populated with VAL_1B, VAL_2B, VAL_3B.
  • any ListBox or ComboBox controls that have the associated property named COL_C_PROP will be populated with VAL_1C, VAL_2C, VAL_3C.
  • properties COL_A_PROP, COL_B_PROP and COL_C_PROP will be directly set to VAL_1A, VAL_1B and respectively VAL_1C (first result set row).

NoteBefore deploying the new result set, the previous binding content will be cleared.

Vertical exampleCopy link to this sectionLink to this section copied!

COL_A
ROW_1VAL_1A
ROW_2VAL_2A
ROW_3VAL_3A

ResultsCopy link to this sectionLink to this section copied!

  • any ListBox or ComboBox that have the associated property named COL_A_PROP will be populated with VAL_1A, VAL_2A, VAL_3A.

Horizontal exampleCopy link to this sectionLink to this section copied!

COL_ACOL_BCOL_C
ROW_1VAL_1AVAL_1BVAL_1C

ResultsCopy link to this sectionLink to this section copied!

  • properties COL_A_PROP, COL_B_PROP and COL_C_PROP will be directly set to VAL_1A, VAL_1B and respectively VAL_1C (first result set row).

ImportantAn empty result set is a valid output.