Specifying a Version Number for a SQL Script File
InstallShield 2016
Project • This information applies to the following project types:
You can assign a schema version number to a SQL script file after you have a created or imported a script file in the SQL Scripts view. Specifying schema version information helps you to trigger the launching of the SQL script only when it is appropriate.
To specify the schema version for your SQL script file:
|
1.
|
In the View List under Server Configuration, click SQL Scripts. |
|
2.
|
In the SQL Scripts explorer, click the SQL script that you want to configure. |
|
3.
|
Click the General tab. |
|
4.
|
In the Schema Version (xxxxx.xxxxx.xxxxx.xxxxx) box, type the schema version number for your SQL script |
The installation checks the current schema version that is on the target database. The schema version is stored in the ISSchema column of the custom table named InstallShield. When you specify a schema version for a SQL script, the installation runs the script only if the script schema version number is greater than the current schema version number. Once the script is executed, the installation updates the current schema version on the target database to reflect the new schema version number.
If you do not specify a schema version number for a SQL script, the script is always launched.
For example, your installation may create a new connection to a database called TestDB and then create a script that is called TestScript and that has a schema version number of 12345.54321.12345.54321. The installation creates the custom InstallShield table in the TestDB database and stores the schema version in the ISSchema column of that table. If another installation is run on that system, and this installation also has a SQL script called TestScript, the SQL script is executed only if the schema version number of this other script is greater than the version number that is stored in the ISSchema column in the InstallShield table of the target database. If the script is executed, the installation updates the ISSchema column with the new schema version number.
Tip • When you specify a number for the Schema Version setting and InstallShield adds the custom InstallShield table for storing the schema version number on the target database, the data is not automatically removed upon uninstallation. Therefore, if you want the installation to be able to roll back the changes, you need to create a custom script upon uninstallation to drop the InstallShield table.
Open topic with navigation