cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rguggisberg
Level 13

How to Execute Stored Procedure

How can I execute a Stored Procedure in my InstallScript MSI project? I already have SQL connectivity and am running scripts, but I don't think the SQL Scripts view is relevant for SPs. I am considering using SQLCMD in a LAUNCHAPPANDWAIT command in my InstallScript code, but I can't even get the command line correct from a command prompt on the target machine.
I also have 2 variables to pass and not sure how to do that either. Can't post what I have tried here because site won't allow it.
Any help is appreciated. Maybe there is a better way to do it. I do know that SQLCMD will be installed, but can't rely on other things being installed.
Thanks
Labels (1)
0 Kudos
(2) Replies
ch_eng
Level 7

rguggisberg,

We use ADO via InstallScript to execute special SQL scripts. The code is based on the example found here:

http://www.installsite.org/pages/en/isp_db.htm

SQL Server Database Maintenance
DatabaseFunctions.zip

HTH
0 Kudos
rguggisberg
Level 13

Thanks for reminding me 🙂
I got this to work by executing LaunchAppAndWait on SQLCMD in a CA. I tried to post part of it here but this sites security rules will not accept it.
0 Kudos