This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- SQL Schema Version
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 23, 2007
04:59 PM
SQL Schema Version
I am trying to utilitize the SQL Schema Version to conditionally run my SQL Scripts. I need to be able to run the setup multiple times on a server and therefore I am not storing anything in the registry or adding entries to the Add/Remove Programs list.
I have one SQL Connection in the project. I have left the Catalog Name and server names blank and I am handling everything from within the SQL Scripts themselves.
I have 7 different scripts in the project that correspond with 7 different databases. The database names are set using properties from a Custom Dialog screen. The scripts determine whether or not the database exists and if it does it deletes it and then recreates.
When I run the setup program the first time it creates the 7 databases and inserts the Installshield table into each with correct Schema version in the table.
From what I read I thought I would be able to run the setup program again and since the schema version in the table matches the version for the script it would not run the script again. What I am seeing is that it is running all scripts again regardless (Destroying and re-creating the databases).
Am I missing something? How do I get this to work?
I have one SQL Connection in the project. I have left the Catalog Name and server names blank and I am handling everything from within the SQL Scripts themselves.
I have 7 different scripts in the project that correspond with 7 different databases. The database names are set using properties from a Custom Dialog screen. The scripts determine whether or not the database exists and if it does it deletes it and then recreates.
When I run the setup program the first time it creates the 7 databases and inserts the Installshield table into each with correct Schema version in the table.
From what I read I thought I would be able to run the setup program again and since the schema version in the table matches the version for the script it would not run the script again. What I am seeing is that it is running all scripts again regardless (Destroying and re-creating the databases).
Am I missing something? How do I get this to work?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 24, 2007
11:53 AM
InstallShield cannot handle the Schema Version property correctly if you change the target database in your SQL scripts. We retrieve the current schema version from the connected database as soon as the connection is established, and write the new schema version to the connected database before the connection is closed.
In your case, the current schema version is retrieved from the default database which is normally 'master' as you leave the Database Name field blank. However, the new schema version is written to the different database that you switch in your scripts.
So I would suggest to you to take the custom error handling approach in order to accomplish your requirements. See this thread for more information.
Hope that helps.
In your case, the current schema version is retrieved from the default database which is normally 'master' as you leave the Database Name field blank. However, the new schema version is written to the different database that you switch in your scripts.
So I would suggest to you to take the custom error handling approach in order to accomplish your requirements. See this thread for more information.
Hope that helps.