SQL Server 2008 R2 – Unattended Silent Install


There is existing documentation on MSDN about How to: Install SQL Server 2008 R2 from the Command Prompt, but this post focuses on creating a silent unattended install of SQL Server 2008 R2 (Standard or Enterprise) using a configuration file. With the instructions below, you’ll be able to create a new customized SQL silent installation in minimal time. Note that the configuration below doesn’t work with the Express edition of SQL Server 2008 R2.

  • Run setup.exe
  • Click on the installtion tab
  • Click “New Installation”
  • Go through the wizard: Enter product key, accept license, install setup support files, and select the features you want to install:
  • Continue the installation until you reach the “Ready To Install” step. Notice the path to the configuration file highlighted below in blue.

  • Now that you have the configuration file, copy it to your own folder or network share where you want to start the unattended installation.
  • Cancel setup since we’re interested in the unattended silent mode of installation; not the UI one.
  • Edit the configuration file as follows:
    • Set QUIET to “True”. This specifies that Setup will run in a quiet mode without any user interface (i.e. unattended installation)
      QUIET="True"
    • Set SQLSYSADMINACCOUNTS to “BUILTIN\ADMINISTRATORS”. This will ensure that administrators on the machine are added as members of the sysadmin role. You can set its value based on your needs (Ex: SQLSYSADMINACCOUNTS=”domain\YourUser”), but this is the more generic approach.
      SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS"
    • Add PID and set its value to your product license key. If your setup.exe already comes preloaded with the key, there is no need to add this option to the configuration file.
    • Add IACCEPTSQLSERVERLICENSETERMS and set its value to “True”. This is to required to acknowledge acceptance of the license terms when the /Q (i.e. QUIET) parameter is specified for unattended installations.
      IACCEPTSQLSERVERLICENSETERMS="True"
    • Remove the ADDCURRENTUSERASSQLADMIN parameter. The reason is that this parameter can’t be used when SQLSYSADMINACCOUNTS is specified, and it only applies to Express installations.
    • Remove the UIMODE parameter as it can’t be used with the QUITE parameter.
    • Remove INSTALLSHAREDDIR, INSTALLSHAREDWOWDIR, INSTANCEDIR parameters since we want to install on the default installation directories.
    • That’s it. If you want to change the features that this setup will install, there is no need to go with the full steps again. You can simply change the value for the FEATURES parameter. For example, the features I selected (shown in first screenshot above) will generate FEATURES=SQLENGINE,SSMS,ADV_SSMS in the configuration file.  You can change that based on your needs. The full list of available feature parameters and their descriptions is located here.

After getting the configuration file ready, you’ll need to create a batch file that will run the silent unattended setup. Simply, create a new file  “InstallSQL2008R2.bat” with extension = “.bat” with the following content, and make sure you replace <path to SQL setup folder> and <path to config file> with the proper values.

@ECHO off
echo Installing SQL Server 2008 R2
date/t
time /t
"<path to SQL setup folder>\setup.exe" /ConfigurationFile="<path to config file>"
date/t
time /t

All we’re doing in the script above is running SQL setup.exe and passing the configuration file as an argument to it. You can download both the batch and config files here.

About these ads
    • Zulfiqar
    • April 11th, 2011

    Awesome…I bow in deference to your detailed explanation which has helped me achieve my goal…Thanks…

  1. You are welcome Zulficar :)

    • Nicus88
    • May 18th, 2011

    I can’t get the configurationfile from the link you put there. Don’t you have another link?
    Thanks!

    By the way, great article

  2. I’ve updated the link in the post…

    • rta1212
    • October 29th, 2011

    Gardaşşş sağ olasın

    • Maheswaran
    • November 14th, 2011

    Hi i need silent installation method Express edition of SQL Server 2008 R2. Please let me know……..

  3. If you need to install quiet silence from c# the code is this:
    Care to take away all spaces in the string argumentos, I don´t know why but they go with the string and doesn´t work properly

    String sqlfile = @”\Msi\SQLEXPR_x64_ESN.exe”; //or wathever sql inst file you have
    myProcess.StartInfo.FileName = sqlfile;
    String argumentos = @”/qs /Action=Install /Features=SQL,Tools /IACCEPTSQLSERVERLICENSETERMS=””True”” /INSTANCENAME=””SQLExpress_AV”” /SQLSYSADMINACCOUNTS=””Builtin\Administrators”” /SQLSVCACCOUNT=””NT AUTHORITY\SYSTEM”” “;
    //MessageBox.Show(argumentos);
    myProcess.StartInfo.Arguments = argumentos;
    myProcess.StartInfo.UseShellExecute = false;
    myProcess.Start();

    • Bob Ashby
    • April 30th, 2013

    Thanks I used this also!!! wonderful!!!

    • Blas Cota
    • July 4th, 2013

    Hi
    When I try to run an install from the command line using setup.exe /CONFIGURATIONFILE=SQLSettings.ini

    I got the following errors:

    Error result: -2067529698
    Result facility code: 1220
    Result error code: 30

    • Nitish
    • March 26th, 2014

    How do I install sql 2008 sp2 enterprise NON R2 silently?

  4. Roofing contractors have to do and is sharing a vast and diverse area.
    45, according to the proposed plans. Substantial changes in your heart.

    After jurors left the foreign service in house remodeling service both in depth research
    and find ways to go it alone. But the bottom-line is that
    they insisted upon a trustworthy roofing contractor from an analog world of good to be used to a successful
    and satisfactory completion.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: