Wewotti
Posts: 4
Joined: Wed Oct 25, 2023 7:29 am

Install SQL scripts on multiple SQL instances

Hello,

I don't know how to run SQL scripts on many SQL instances on the same time. I have no problem to connect to one instance and run the scripts.
But I want to Browse and select a textfile with instances in it and connect to them. Confirm that the connections is successful and run a bunch of SQL scripts.
Is that possible?

Thanks in advance,

BR,
Anders
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Install SQL scripts on multiple SQL instances

Hello Anders and welcome to our forums,

This would be achieved by creating multiple connections in the SQL page.

Each connection would then have its' scripts to executed.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Wewotti
Posts: 4
Joined: Wed Oct 25, 2023 7:29 am

Re: Install SQL scripts on multiple SQL instances

Hi Catalin,

Thank you very much for your answer.

I'm not really sure how I should be doing these multiple connections. Like say if I have 40 instances in my text file that I would like to run the scripts on, how will I do that?

BR,
Anders
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Install SQL scripts on multiple SQL instances

Hello Anders,

When you mentioned multiple instances, I did not quite expect such a large number.

How this works in Advanced Installer is that you have a connection to the database, on which we run the script after the connections has been established.
Screenshot_75.png
Screenshot_75.png (15.92 KiB) Viewed 21685 times

However, considering the large number of instances, the amount of manual work would have to be equal. We would need to create each connection separately and then for each connection to add the script.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Wewotti
Posts: 4
Joined: Wed Oct 25, 2023 7:29 am

Re: Install SQL scripts on multiple SQL instances

Ok,

So can I to prepare in advance many different SQL connections with different names and when I apply a text file with lots of instances can these instances then be linked to the SQL connections through the value properties some how?

BR,
Anders
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Install SQL scripts on multiple SQL instances

Hello Anders,

To achieve what you want, we can make use of the SQL Powershell automation.
Screenshot_82.png
Screenshot_82.png (108.63 KiB) Viewed 18500 times

In your case, you would need to get your file, loop through each connection and for each call the NewCustomConnection method.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Wewotti
Posts: 4
Joined: Wed Oct 25, 2023 7:29 am

Re: Install SQL scripts on multiple SQL instances

Thank you for your answer.

I'll try this and see if I need some more help with it.

BR,
Anders
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Install SQL scripts on multiple SQL instances

You're always welcome, Anders!

And sure, if you require any further assistance, please let me know and I will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”