btrimpop
Posts: 10
Joined: Mon Mar 23, 2009 3:03 pm

Running a batch (.bat) file

Hi,

I need to have a SQL install that runs some .SQL scripts to create tables etc. then it needs to run a .BAT file to BCP data into the tables and then it needs to run more .SQL scripts.

I can't seem to figure out how to run a batch file in the middle of running sql scripts. How would you recommend or is there a way to accomplish this?

Thanks
Bruce
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Running a batch (.bat) file

Hi Bruce,

Unfortunately the SQL Scripts feature in Advanced Installer runs all the scripts one after another. However, you could try this approach:
- set the first set of scripts in the SQL Scripts page
- use a Launch file or open URL custom action scheduled under "InstallExecuteSequence" -> "Install" to run the BAT
- use sqlcmd.exe as a custom action to run the second set of SQL scripts (the custom action can be scheduled after the BAT)

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
btrimpop
Posts: 10
Joined: Mon Mar 23, 2009 3:03 pm

Re: Running a batch (.bat) file

Thanks Cosmin, I'll give it a try.

Return to “Common Problems”