This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Execute SQL scripts against multiple databases
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 06, 2010
09:37 AM
Execute SQL scripts against multiple databases
I've searched the threads and cannot find exactly what I need.
I have a project that I need to create an installer to execute 5 SQL scripts against multiple databases on the same SQL instance. What my manager would like is a list box of databases on the SQL instance to be shown. Then have the ability to select the databases he wants to update and run the SQL against those databases. When the installer finishes return a log of the updates.
The SQL server engine will be SQL 2005. The installer will be run on the server itself via remote desktop so using SQLDMO is a viable option. The installer will be an InstallScript MSI project.
Thanks for any advice you can give me.
TPat
I have a project that I need to create an installer to execute 5 SQL scripts against multiple databases on the same SQL instance. What my manager would like is a list box of databases on the SQL instance to be shown. Then have the ability to select the databases he wants to update and run the SQL against those databases. When the installer finishes return a log of the updates.
The SQL server engine will be SQL 2005. The installer will be run on the server itself via remote desktop so using SQLDMO is a viable option. The installer will be an InstallScript MSI project.
Thanks for any advice you can give me.
TPat
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 06, 2010
11:51 AM
You may want to consider using the SQL Scripts view in order to accomplish your requirement. In the view, you need to simply add a connection and the SQL scripts that you want to run against the target database server. At run-time, InstallShield automatically displays the SQLLogin dialog which has the server browse button and database catalog browse button. In the Target Database Catalog field, you can specify multiple database catalogs by separating them with a semi-colon, and InstallShield will run the SQL scripts associated with the connection against the specified database catalogs. One thing that you would need to elaborate is to use a multi-selection list box control in the Database Catalog Selection dialog, and create a semi-colon delimited list if more than one database catalog are selected.
Hope that helps.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 06, 2010
12:14 PM
hidenori wrote:
You may want to consider using the SQL Scripts view in order to accomplish your requirement. In the view, you need to simply add a connection and the SQL scripts that you want to run against the target database server. At run-time, InstallShield automatically displays the SQLLogin dialog which has the server browse button and database catalog browse button. In the Target Database Catalog field, you can specify multiple database catalogs by separating them with a semi-colon, and InstallShield will run the SQL scripts associated with the connection against the specified database catalogs. One thing that you would need to elaborate is to use a multi-selection list box control in the Database Catalog Selection dialog, and create a semi-colon delimited list if more than one database catalog are selected.
Hope that helps.
I'm kind of new to this so a little more explanation would help. Are you saying I need to edit the Database Catalog Selection dialog? If so where is it as I can only find the SQLBrowse dialog. I want this to be as user friendly as possible for the end user hence the multi-select list box control.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 06, 2010
04:10 PM
The SQLBrowse dialog is used for both Database Server Selection dialog and Database Catalog Selection dialog. So you would need to create a very similar dialog to the SQLBrowse dialog with a multi-selection list box control, and customize the SQLDatabaseBrowse and SQLServerSelectLogin2 functions so that the SQLLogin dialog will use the new browse dialog for the Database Catalog Selection dialog.