We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mig28mx
Posts: 2
Joined: Wed Oct 14, 2015 11:25 pm

Multiple sql databases on the same instance

Hi all,
Is there any option to allow to install the same script over multiple databases, instead of doing one by one?
In my case, I have three database servers: Prod, dev, QA, and each have 60 databases. So, if i need to deploy on the three servers, I have to do it 180 times.

Anyone have been faced with a similar situation?

Thank you in advance.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Multiple sql databases on the same instance

Hello and welcome to Advanced Installer,

In this case you can create 3 connection to the servers, one connection for each server. For this, you can use the custom connection method from the Custom SQL Connection Page. From the connection string, please delete the Database=[DBNAME_PROP]; parameter. So, the connection string should look like this:

Code: Select all

Driver={[DBDRIVER_PROP]};Server=[DBSERVER_PROP];Port=[DBPORT_PROP];Uid=[DBUSER_PROP];Pwd=[DBPASS_PROP];
In your SQL SCript you will handle the databases. So, you will only have three connection, one connection for each server. Inside each script you will list the databases of each server and perform the requested operations.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mig28mx
Posts: 2
Joined: Wed Oct 14, 2015 11:25 pm

Re: Multiple sql databases on the same instance

Hi Dan,
Thank you for your answer.
I will perform some tests and I will let you know the results.

Regards.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Multiple sql databases on the same instance

You're welcome,

Should there be any difficulties you may encounter, please let me know and I will gladly assist you.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ArnieC
Posts: 2
Joined: Wed Jan 11, 2017 2:09 pm

Re: Multiple sql databases on the same instance

Dan wrote:...Inside each script you will list the databases of each server and perform the requested operations.
Dan
What do you you mean by this statement?
If I have one .sql script file to run against multiple databases, are you saying that the .sql script file need to have a "USE <DBNAME>" statement 60 times?
For Example: my .sql script file installs one or more stored procedures in the target databases. Each target database has the same structure just a different name.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Multiple sql databases on the same instance

Hello Arnie,

What my colleague tried to say was that you will have to execute a loop statement into your SQL Script code to run the script for all of the required databases. You should just iterate in your SQL code all the required databases and run the same statement against each database. Just take a look on my answer from "SQL Database Installation from Script Files | Multiple Databases" thread

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

Return to “Building Installers”