Blog Post

Core Infrastructure and Security Blog
2 MIN READ

Quickly create A LOT of SQL Instances

SQLPFE's avatar
SQLPFE
Brass Contributor
Mar 15, 2019

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 https://msdn.microsoft.com/en-us/library/cc645993.aspx#RDBMSSP .

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.

!!WARNING!!! -   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 https://1drv.ms/t/s!AqiyUGOT8PbNt68ztGHGU7kgZBP-Tg .

    1. Save file as a .cmd

 

    1. Edit the values for ADMIN_ACCOUNT1 & 2 with your windows accounts

 

    1. Make sure your SQL 2016 DVD is mounted to 😧

 

    1. Run



Additional Notes

    1. I tested this with SQL 2016, but older versions should work too.

 

    1. 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.

 

    1. The script installs instances with Manual start mode. You can then use these cmd files to https://1drv.ms/t/s!AqiyUGOT8PbNt680MDnz_Vze61kp4Q and https://1drv.ms/t/s!AqiyUGOT8PbNt681KDALfbHp3thSPw the services

 

    1. If you want your instances to autostart, adjust /SQLSVCSTARTUPTYPE=Automatic in the script before running it.



Updated Apr 28, 2020
Version 2.0
No CommentsBe the first to comment