tnomore
Posts: 16
Joined: Wed Oct 31, 2007 5:14 pm

Sql Script Order of Execution

Hi.

Within a single SqlConnection, I understand the order in which a Sql Script is executed is determined by where it appears in the list under the connection node.

How about when more than one SQL Connection is used?

For example: I have two SQL Connections, "Master" and "Books".

All the scripts under the "Master" SQL Connection must run before those in "Books". In testing, it does not appear that multiple connections are considered when execution order is determined. In reviewing the ".aip" file, i notice that the first script in each SQL Connection is assigned the value [Order="0"].

Is there any way to ensure that scripts of one connection run before those in another? For arguments sake, let's say that it is not possible to use a single SQL Connection with a series of "using [database name]" statements embedded within them.

This seems like an obvious requirement, yet I do not see it supported.

thanks.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This feature is on our TODO list and it will be available in a future version of Advanced Installer.

Since the order of the connections is set alphabetically, you need to make sure that the connections are ordered alphabetically in the "SQL Scripts" page by renaming them. For example, you can use the "_Master" (instead of "Master") and "Books" SQL connections.

Note that the scripts will be executed normally (in the order in which they appear).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tnomore
Posts: 16
Joined: Wed Oct 31, 2007 5:14 pm

thanks cosmin.

for now, that is an acceptable work-around.

Return to “Common Problems”