Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
What media are you using? MSDN ISOs are pre-pidded, and the bits matter; retail media should ask for a license key, and this is what drives the edition (there's nothing in the registry before the installation). – Aaron Bertrand Apr 23 '13 at 19:50
Just curious, are you writing your own automated deployment build for SQL Server ? If that is the case, have you looked at SPADE Its already out there and uses PowerShell. – Kin Apr 23 '13 at 19:53
@AaronBertrand It is the ISO. Volume licensing – Pete Carter Apr 23 '13 at 20:16

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"

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

share|improve this answer

Yes, you can read from the registry code similar to this.

long tLong = (long) Microsoft.Win32.Registry.GetValue(keyName, "TestLong",

Then you can use an "if" statement to determine what to do next.

share|improve this answer
Thanks but as Aaron says above, there will be nothing in the registry to read at this point. My comment refering to registry was more about - If the version cannot be selected during the silent instal, can it be chaned post install – Pete Carter Apr 23 '13 at 20:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.