How to perform a command line installation of SQL Server 2005

I was asked by a customer a while back about available options for performing silent installation of SQL Server 2005 Express Edition.  I haven't had a lot of time to research this issue, and the only steps I knew were the ones used by Visual Studio setup to install SQL Express.

Now that I looked into this scenario a bit more, I found an MSDN document entitled How to: Install SQL Server 2005 from the Command Prompt that provides in-depth instructions regarding supported command line switches for SQL 2005 setup and steps for creating an automated installation answer file.

The instructions in this document will allow you to perform all of the following configuration tasks, plus several more that I didn't list:

  • Install a standalone SQL instance

  • Install a clustered SQL instance

  • Rebuilding SQL databases

  • Add/remove individual components

  • Add/remove nodes in a cluster

  • Uninstall a standalone SQL instance

  • Uninstall a clustered SQL instance

Please note that these instructions are generic and apply to all versions of SQL Server 2005.  Some of the advanced configuration options are not supported by SQL Server 2005 Express Edition, so you will need to make sure to only attempt to install the Express Edition using switches and options that it supports.


Comments (6)

  1. qisope says:

    Ever tried a SQL Express installation with command line options, launched from the RunOnce registry key?  Or launched using the CreateProcess API call from a process that was launched from the RunOnce key?

    Interestingly, I found that sqlexpr32.exe, the SQL Express setup application totally ignores its command line options when the start of the process tree it is part of is launched from RunOnce.

    The only way I found to get it to pay attention to the command line options was the use ShellExecute, instead of CreateProcess.


    Try it – Add the following to the RunOnce key:

    sqlexpr32.exe -q /norebootchk /qn reboot=ReallySuppress addlocal=all instancename=SQLEXPRESS SQLAUTOSTART=1

    Should perform a silent install, but the UI will show up!  Run the same thing from the command prompt, and it will be silent.

    Don’t know if the same applies to the SQL Server installer.

  2. Hi Qisope – I haven’t heard of this issue before, but I had another customer post about a similar experience at  I don’t know whether or not this is intentional for SQL setup to behave that way, but I would suggest reporting this as a bug on the Product Feedback site ( and see what the SQL team has to say about this scenario.

    In the meantime, you might want to try to launch SQL setup using a wrapper batch file that you call from the RunOnce registry key and see if that can be used as a workaround.  Please let me know how it goes by posting a follow-up comment if you see this….

  3. This guide is intended to serve as a collection of links to articles, tools, tips and tricks that explain

  4. How to install SQL Server 2008 R2 Native Client at Custom Location says:


    I am trying to install SQL Server 2008 R2 Native Client at custom location.

    For this I tried various approaches:

    1. Installing by double clicking the msi:

    In the installer screen browse button is disabled and it's not possible to provide custom installation path.

    2. Command line instruction:


    where %3 is the user specified custom installation path.

    Even after specifying the custom path, the Native Client is getting installed at the default path only. (<program files>Microsoft SQL Server).

    – I also tried executing the following command but this too is not working:

    msiexec /i “<MSI Path>” INSTALLDIR= “<Custom Path>”

    When I installed the SQL Server Native Client through SQL Server Installer by providing custom path on the features selection page, the Native Client got installed at custom location.

    As SQL Server installer is able to do it, there should be some parameter through which it provides custom path to the Native Client installer.

    Please let me know if there is any such parameter or any other way to install SQL Server 2008 R2 Native Client at custom location.

    Thanks & regards,


  5. Hi Apeksha – I don't have enough expertise in how SQL Server setup works to be able to answer this question.  I'd suggest posting a question on the SQL Server Setup forum at…/threads and hopefully someone there will be able to help.

Skip to main content