BCh
Posts: 63
Joined: Wed Jan 17, 2007 6:32 am
Location: Australia

Custom Actions and Server SQL Databases Scripting Sequence.

Hi,

Trying to look at exporting (using bcp) certain tables of a SQL database, dropping the previously installed database, restoring the database (updated as part of the Installer script) and then importing the already backed up tables again using bcp.

I.e. need to keep data in certain tables that have been updated by the customer but update other tables supplied by me.

I have batch files for the exporting and importing of the tables but trying to figure out where I place the custom actions in the Custom Behaviour | Custom Actions | Install Execution Stage.

Need to put the Custom actions one each side of the SQL Scripting (in Server SQL Databases | Database server)


OR

Do I have to do all this in the Server | SQL Databases | Database Server in the SQL Script tab with other scripting that drops the database and restores it.


Thanks,

Brian
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom Actions and Server SQL Databases Scripting Sequence.

Hello Brian,

You should schedule your backup DB custom action before "Install Execution Stage" -> "Preparing" action group (during "Preparing" the old product will be removed) and the restore DB custom action must be scheduled as deferred after "Install Execution Stage" -> "Add Resources" action group. During the add resources action group the SQL scripts are executed on deferred stage of the installation.

Let us know if you have any questions or doubts.

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

Return to “Building Installers”