Joshr
Posts: 33
Joined: Mon Dec 14, 2015 5:40 pm

Scheduling of SQL Scripts & Custom Actions

Hello,

I'd like to request the ability to schedule MS SQL Server Scripts as deferred custom actions. Sorry if this is suggested before, but I haven't found anything through searching the forum.

We have a fairly decent chunk of data to load into some SQL Database tables during our installation and upgrade process. Thea amount of data is too large for Advanced Installer's SQL Scripts functionality and breaking the data into smaller pieces would be unmaintainable as the data changes fairly frequently. Instead, we're using a deferred custom action that loads the data into the database tables from a compressed file format we have developed.

This issue we're running into is we would like to use Advanced Installer's SQL Script capabilities, but we can't run some scripts, execute our custom action, and then run more scripts.

The workflow we need is:
  1. Create the database (Script)
  2. Create the tables, views, stored procedures, and functions (Script)
  3. Import the data (Custom Action, which also updates progress)
  4. Create Indexes (Script)
  5. Create foreign key/check constraints (Script)
Step 4 is done after the data load for efficiency reasons. While we can move step 4 to step 2, at the cost of a slower install, we can't move step 5. The constraints can't be applied until after the data is loaded or foreign key checks will fail during the import process.

Right now our work-around is to code our own custom action to execute SQL Scripts, which is unfortunate. We'd really like to be able to use the functionality built-in to Advanced Installer.

Thanks for your time.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Scheduling of SQL Scripts & Custom Actions

Hello and welcome to our forums,

To achieve what you want (run a SQL script during a certain/custom sequence during installation) you can simply use our "SQl Query" support. Every SQL Query added in "SQL Databases" page is bound with a "Query SQL database for data" custom action which you can schedule anywhere during the installation sequence.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Joshr
Posts: 33
Joined: Mon Dec 14, 2015 5:40 pm

Re: Scheduling of SQL Scripts & Custom Actions

Thanks for the response, Daniel.

Unless I'm misunderstanding your instructions, I can't use SQL Query actions as the UI will not let me mark them as deferred; only immediate. The scripts make changes to the system, so I can't run them as immediate custom actions.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Scheduling of SQL Scripts & Custom Actions

You're welcome.

You can schedule the SQl Query action as deferred. To achieve this just go to "Custom Actions" page and delete the default added SQL Query action under "Wizard Dialogs Stage". Then just move the remained SQL Query action in the "Install Execution Stage" in the desired place in sequence and mark it to run as deferred.

If you have any questions just let us know.

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

Return to “Feature Requests”