Control the order of the SQL Scripts

Got a problem you cannot solve? Try here.
Post Reply
bishopj
Posts: 5
Joined: Wed Jun 03, 2009 5:52 pm

Control the order of the SQL Scripts

Post by bishopj »

High I have searched but can not find a definative answer to this.

Version: Installaware 8 Studio

I need to be able to do two :

1. Get the name of the database a user has entered in the database script commencement field so I can use it the SQL scripts (at the moment I can live with my current solution of defaulting the database name if necessary)
2. Control the order of the SQL scripts executed if several scripts are created - or do I have to slam everything into one 15Mb script? (Not really happy with that option as the scipts have logically different purposes and work on different databases), and I may need to prevent to the running of a script if another script has generated specific errors.


SQL Scripts seem to be sorted in reverse order to that to which they are added.

Any ideas?
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Just swap to MSIcode and order your scripts any way you like, for #2.
I am not sure, however, what you mean by #1 "commencement".
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
bishopj
Posts: 5
Joined: Wed Jun 03, 2009 5:52 pm

Post by bishopj »

MichaelNesmith wrote:Just swap to MSIcode and order your scripts any way you like, for #2.
I am not sure, however, what you mean by #1 "commencement".
Ok - Understand #2 - I missed the fact that if I double clicked on the entry in the MSI script it brought up the edit box plugin with the code embedded. As there was no "Name" on the script I couldn't see which one was in which order. (kind of new to this and learning the MSI scripting as I go...)

On #1 there was a keyboard accident. That was meant to be database name in the database name field of the sql dialog box...but since I am yet to run this I am working on the assumption that when the SQL script gets executed the dialog box is displayed to the user, and thus they can enter/change the database name...BUT if that is not the case, I suppose I will have to create a dialog that IS displayed to the user.

And yes - I know I could theoretically run it all and find out if the database sql dialog displays, but I am running out of clean machines and really need to be able to test this first time on a machine that has never had the application near it - and I have two left - so I want it to be as close to working first time as I can get it. (And we are already over deadline)

On a related point...how do I do a "debug build" which it keeps asking me for, but I can not for the life of me find out how to generate it.

Edit:
Actually one more thing, It would be good to be able to specify the collation for MSSQL servers directly in that SQL dialog so that you can ensure the database is created with the correct collation, rather than having to issue an alter database collation instruction immediately thereafter (which is the primary reason why I need to know the database name they are using). In SQL Express, MS in their infinite wisdom decided to change the default collations from SQL to windows - so which creates a mess in the views when the tables are built on full SQL server using SQL collations and the target is Express defaulting to windows collations.

Regards
JB
Post Reply