Reputation: 173
I have three different chocolatey package for mssql 2012, 2014, 2016
What do i need to do so that i can pass a command like:
choco install mssqlserver --version 2012
and that should install 2012 mssql server.
Thanks.
Upvotes: 2
Views: 5153
Reputation: 12561
So far you are good to go with how you would specify a version. What you've posted is exactly right:
choco install mssqlserver --version 2012
You just need to tell Chocolatey where to get those packages from, whether it be an explicitly passed --source
or in your default sources. See https://chocolatey.org/docs/commands-source for more information on setting default sources for your packages.
Every piece of software is different. In this case you don't typically upgrade from 2012 to 2016, you bring up a 2016 and migrate the data. So you wouldn't follow a normal package upgrade in this instance. You may also wish to leave 2012 on 2012 for a longer period of time and take minor updates.
So in a case like this, where SQL Server 2012, 2014, and 2016 might have small updates, you would want 2012 to likely stay on 2012. We'd recommend separating those out into differently named packages.
Thus mssqlserver-2012
, mssqlserver-2014
, and mssqlserver-2016
.
If you leave it as mssqlserver
, when you push all versions of mssqlserver
up and specify a particular version to install (like 2012), you would also need to pin to that version otherwise the next choco upgrade all
would attempt to upgrade mssqlserver
to 2016.
Upvotes: 6