cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ashahidi
Level 4

SQL Scripts Issue

I have a web project where I want SQL Scripts to only run the first time the product is installed. This part works fine. The second part of it is that I have set a conditional statement for each SQL Script so it should only run when it is NOT Installed.

So ideally, if I run the installer again and I pick the Repair option, the scripts should NOT run due to the fact that they have already been installed and due to the condition not being met. However, they are still being run.

Does anybody have any ideas as to what else I could try?

Thanks in advance.
Labels (1)
0 Kudos
(2) Replies
hidenori
Level 17

I recommend that you use the Custom Error Handling functionality in order to accomplish your requirement, instead of using Windows Installer's component conditions. You need to check something on your database to determine whether you should run your SQL script or not. Please refer to this thread for more information about it.

Hope that helps.
0 Kudos
ashahidi
Level 4

I ended up using an IF, Begin...End statement within my SQL scripts and that seems to have gotten the job done. Thanks for your help.
0 Kudos