Sql-server – Dictate edition during unattended install

installationsql serversql-server-2012

I am creating an automated build of SQL Server installation which is run from a batch file. Is there any way to change the registry, or other method, of deciding which SQL Server edition (Either Enterprise or Standard) will be installed, or are the two versions still separate builds?

If they are separate builds, I guess I could get around it, by having a "master" batch file call an appropriate "child" batch file, but this would mean having a folder which contains both sets of binaries, which I rather avoid.

Best Answer

Per my answer here, the installation media contains every edition, and it's the licence key that dictates which licenced edition is available. The ISO you get from MSDN comes with a key for the edition specified on MSDN, but the key can be replaced with any valid key, as it's in a configuration file.

If you need to deploy an arbitrary licenced edition, you'll need to collect a set of licence keys for each edition you want to deploy, then use conditional logic in your scripts to use whichever one is appropriate.

The main piece you're missing, though, is to perform an edition upgrade. This will take the default install from Enterprise Evaluation to the edition defined by the licence key provided.

Here's the relevant part of the script I used in such a deployment, that uses the licence key that was provided with the installation media (presumably, you'll want to modify that part):

"C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2\Setup.exe"
    /ACTION="Upgrade" /QS /CONFIGURATIONFILE="%installMediaPath%\x64\DefaultSetup.ini"
    /INSTALLMEDIAPATH="%installMediaPath%\x64\Setup" /INSTANCEID="MSSQLSERVER"
    /INSTANCENAME="MSSQLSERVER" /IACCEPTSQLSERVERLICENSETERMS

Note the presence of the user-defined variable %installMediaPath%, which I assume you'll have in your script. This script was written for 2008 R2, but I think it should work with 2012 (untested).