cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
skr
Level 6

Order (sequence) of sql scripts

Hi

I am rinning a InstallScript MSI project.

I need to install three sql scripts on a database.
Script 1: Generate the database
Script 2: Insert default data
Script 3: Create additional stored procedures.

How do I ensure that the scripts are run in order 1 - 2 - 3.

I can't see any places to define the sequence in the SQL Scripts view?


Update: I found the solution.

Go to Direct Editor and select view ISSQLConnectionscript
Labels (1)
0 Kudos
(2) Replies
hidenori
Level 17

SQL connections and scripts will be executed as shown in the SQL Scripts view. You can change the order by selecting Move up or down from the right-click shortcut menu.
0 Kudos
gridman
Level 8

I have never done an InstallScript MSI project, but in a Basic MSI project, in the Sql Scripts view, you right-click on Sql Scripts, then click New SQL Connection. Then you right-click the connection and click Insert Script Files. Do that to add all your scripts.

Now, the first script in the list (at the top) is the one that will be executed first. The next one down (the second one) will be executed next, and so forth. The one at the bottom of the list will be executed last.
0 Kudos