I had some spare time lately and I had the chance to re-write one of my old favourite tools: QueryLauncher.
Sometimes you find yourself alone and you need to run a query or a set of queries against a data warehouse that has hundreds or thousands of SQL Server instances. How to do that?
Poor DBA needs help, presto!
You need to download QueryLauncher which consists in:
- Queries: a folder in which you put your queries
- Results: a folder in which you will have the results
- QueryLauncher.ps1: the actual script that will make the job for you
Install-Module -Name dbatools Install-Module -Name ImportExcel
Then modify the first line of the script and insert a list of target server names:
$SqlInstances = 'ServerName1','ServerName2','ServerName3'
…and voilà, you are good to go, watch the video:
I really like this tool as it allows me to run not only one query but a set of queries against a whole data warehouse.
And now stop blogging and go to do real work, poor DBA!