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

"Run Script During Login" ignore conditions.

My installer should allow installation of multiple databases.
To do this i created new connection in "SQL Scripts" category with two script files.
"Run Script During Login" checked for both..
As i understand this means that ISSQLServerValidate action will run scripts.
But i want only one script to execute accordingly to type of db, so i specified conditions for each script. But installer ignore them, and both scripts executes.
When "Run Script During Install" checkbox checked, all ok. Scripts executed accordingly to conditions.
Can anybody explain this?

Also i found IS_SQLSERVER_CXNS_ABSENT_FROM_INSTALL property:
"Specifies one or more SQL connections that should be skipped during installation or uninstallation. To specify more than one SQL connection, separate each with a semicolon (;). To skip all of the SQL connections, set the value of this property to ALL. Using this property is helpful if you cannot uninstall a product because of a SQL scripting error. "
But this property also doesn't work with "Run Script During Login" option :(((
Labels (1)
0 Kudos
(1) Reply
hidenori
Level 17

I worked with Marachkovski offline and solved the issue. The SQL Scripts are explicitly tied to component states, and the condition that you are setting in the SQL view is actually the condition on the underlying component. Therefore, the condition only works for SQL scripts that run during install. The solution was to coditionally run the SQL scripts using a RAISERROR T-SQL statement and Custom Error Handling functionality.
0 Kudos