Problem with SQL script - Advanced Installer Community
jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

Problem with SQL script

Hi,
I have a feature that is installed locally called SQLINSTALLATION.

For a particular SQL script I have the following condition: -
(&SQLINSTALLATION = 3) AND (PRIMARY_DATABASE_VERSION <> "000000000") AND (PRIMARY_DATABASE_VERSION < "005014000")
The primary database version is set to "006002000".

I would expect the test to be true as I have checked the feature to be installed locally.

However, I get an error because there is a reference to sys.objects in the first few lines of the sql script. This is ok I can change it to sysobjects.

My point is why is it attempting to run the script at all? Does it do a parse before checking the condition?

Regards,
John
jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

Re: Problem with SQL script

Hi,

Changed sql script to use: -
IF EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[dir_secy_message_salu]') AND type in (N'V'))
DROP VIEW [dbo].[dir_secy_message_salu]
GO

So, now there is no error from the script but I am still having a problem with this script being loaded.
Did this: -
replaced (&SQLINSTALLATION = 3) with ((&SQLINSTALLATION = 3) AND NOT (!SQLINSTALLATION = 3)) with the same tests for database version. This is one of the pre-defined conditions. It still installs the stored procedure.

There is some information here http://www.advancedinstaller.com/user-g ... ialog.html
Is there a definitive list of what the values mean i.e. 3, 5 etc.

Regards,
John
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Problem with SQL script

Hello John,

I'm not sure why this happens. The related script should not execute when "PRIMARY_DATABASE_VERSION" property is set to "006002000". Could you please also send us a verbose log of the installation to support at advancedinstaller dot com so we can investigate it too?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”