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

Running SQL scripts in an InstallScript MSI project

I believe, in an InstallScript project you can use SQLRTComponentInstall and SQLRTComponentUninstall to run component associated scripts.

Can these be called within an InstallScript MSI project ?
Or is there an alternative script function to do something similar ?

I want to run an SQL script from InstallScript during an installation, either one associated with a component or a custom made string.

Does anyone know how to do this and does anyone have an exmpe ?
Labels (1)
0 Kudos
(2) Replies
hidenori
Level 17

The SQLRTComponentInstall and SQLRTComponentUninstall functions are not available in InstallScript MSI projects. You may want to consider using the SQL Scripts view under the Server Configuration section which will tie your SQL scripts to an individual component and execute them by the ISSQLServerInstall and ISSQLServerUninstall actions. See the SQL Scripts view help topic for more details.
0 Kudos
jonathanqis
Level 6

I wish to run the scripts earlier in the install. I see no mechanism to control the time the scripts are run using the 'Server Configuration\ SQL scripts\ connections mechanism.
I'm trying to avoid the 'applications to be stopped' dialog because SQL Server is listed and we can NOT stop this during our install/uninstall.
We have dlls loaded into SQL server (extended stored procedures) but we can un-load them with an sql script. I have tested and confirmed that if this script is executed after the UI sequence and early enough in the execute sequence, the request to stop SQL server is not presented and our install goes through OK.
0 Kudos