First published on MSDN on Aug 17, 2016
Recently I delivered a demo on Policy Based Management for a customer. To show this off well, I really wanted to have a larger number of SQL servers to show how PBM can be used to manage SQL Server sprawl. I can only fit a few VMs in my laptop and Azure would burn though my $150 MSDN credit too quickly, so I decided to look for other options. I then remembered that SQL Server supports up to
50 instances on the same machine
I’m too lazy to click Next > Next > Next that many times, so I made a script to automatically install 50 instances of SQL on the same machine.
- This will blow up the size of your SQL install directory significantly! (about 1GB per instance with SQL 2016).
Do not run this on production servers or any server that you even remotely care about!
If you are ok with this warning, you can get a copy of the script
Save file as a .cmd
Edit the values for ADMIN_ACCOUNT1 & 2 with your windows accounts
Make sure your SQL 2016 DVD is mounted to D:
I tested this with SQL 2016, but older versions should work too.
For my install, I canceled after about 20 instances since my C: drive was getting too big. You can cancel the CMD if you feel you have enough instances, but let the final install complete normally.
The script installs instances with Manual start mode. You can then use these cmd files to
If you want your instances to autostart, adjust /SQLSVCSTARTUPTYPE=Automatic in the script before running it.