SQL SERVER – 2005 – Silent Installation – Unattended Installation

Silent SQL Server 2005 Installation is possible in two steps. Here are both steps for a silent installation, with the setup switches.

SQL SERVER - 2005 - Silent Installation - Unattended Installation

1) Creating an .ini file
The SQL Server CD contains a template file called template.ini . Based on that create another required .ini file which includes a single [Options] section containing multiple parameters, each relating to a different feature or configuration setting.

2) Run Setup on command prompt
On command prompt type following script

setup.exe
/settings <path TO .ini FILE>

If location of sqlinstall.ini file is at C:\SQLSetup folder. The command to initiate silent installation is:

setup.exe /settings C:SQLSetup sqlinstall.ini

Specify the /qn switch to perform a silent installation (with no dialog boxes) or the /qb switch to specify that only progress dialog boxes should be displayed.

Tips for a Smooth Silent Installation

The real benefit of an unattended setup is that every server gets installed the same way. Once the .ini file is right, the tenth install looks exactly like the first, which makes support much easier.

A few things I suggest before you rely on it:

  • Test the file on a virtual machine first. Use /qb for the first runs so you can watch the progress, then switch to /qn once you trust it.
  • Protect the .ini file. If it holds the sa password or service account passwords, anyone who can read the file can read them.
  • Keep a copy of each file, with the passwords removed, and a note on which servers it was used for.
  • Read the setup log files after every install. A setup that fails quietly shows no message box, so the log is where you find out.

Newer versions work a little differently. From SQL Server 2008 on, setup uses a ConfigurationFile.ini with switches like /Q and /ConfigurationFile, and the setup wizard saves that file for you just before it installs. Walking through the wizard once and keeping that file is the easiest way to build one.

Whatever the version, finish with a quick check: connect, run SELECT @@VERSION, and confirm that the features, collation and service accounts are what you asked for.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.

SQL Scripts, SQL Server Security
Previous Post
SQL SERVER – 2005 Reserved Keywords
Next Post
SQL SERVER – UDF – User Defined Function to Extract Only Numbers From String

Related Posts

19 Comments. Leave new

  • Hi!

    Could you help me please?

    I’m building a setup for my application that requires SQL Server Express Edition installed …
    So, before I start copying files, I launching the executable for the installation of SQL Server from an INI file in silent mode (/qn parameter).
    My question is: how do I know automatically when the SQL Server installation is ended successfully or not?
    Are there some return values on which I can rely?

    Thanks

    Mark

    Mark

    Reply
  • Hi

    If I would like to install SQL Server 2005 Express as a prerequisites with my application which is created using VS 2008, How can I set the above parameters?

    thanks

    Khayralla

    Reply
  • Palanivel Rajan
    February 19, 2009 3:08 pm

    Hi ,

    I am trying to install SQL SERVER 2005 in silent mode.

    While proceeding after completion of 1st CD, I got “Insert CD 2” message box.

    I inserted the 2nd CD; but still am getting the “Insert CD 2” message box.

    Please give me your inputs

    Regards,
    Palani

    Reply
  • Ravishankar Chinnur
    February 21, 2009 10:49 am

    Hi Palanivel Rajan

    The alternative method is ,copy two cds in to hard disk and try

    definatly it will come

    Regards

    Ravishankar Chinnur

    Reply
  • Ravishankar Chinnur
    February 21, 2009 10:52 am

    Hi Palanivel Rajan

    But my question is how can we hide all ui screens in sql server
    2005.i.e., it should not display any set up windows while installing

    Thanks a lot

    Ravishankar Chinnur

    Reply
  • To hide all setup dialogs use the /qn switch instead of the /qb switch.

    Reply
  • Hello,

    Do you have any idea why a SQL Server security patch continues to attempt to install itself even when auto-update is disabled? KB959195 has attemped to install and failed every night around midnight, breaking my cluster and leaving SQL Server resources in a failed state. What in the world is it that Windows or SQL Server is ‘looking’ at that kicks off an unattended patch install like this?

    How can I ensure the that auto-update leaves my SQL Server patches alone?

    I’d appreciate any insight. Thanks!

    Cindy

    Reply
  • I note all examples specify the full path (including drive letter) of the .ini file.

    I want to install from a CD, or USB memory stick, and do not know what the drive letter will be on the target machines.

    If I only use a relative path, the installer looks for the ini file in C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\ and of course it is not there.

    How can I use a relative path to the .ini file?

    Reply
  • Hello,

    i try to create my own sql server 2005 express installation with SSME.ini as below, but my Mixed Mode Dialog Box Password Still Blank.

    Did anyone can help me

    [Options]
    USERNAME=ABC => Status Ok
    COMPANYNAME=XYZ => Status Ok
    ADDLOCAL=ALL => Status Ok
    INSTANCENAME=SQLEXPRESS => Status Ok
    SECURITYMODE=SQL => Status Ok
    *****************************************

    SAPWD=sql => Status Ng

    Why Mixed Mode Dialog Password Still Blank ??
    Did i miss some Setting ??

    *****************************************
    SQLBROWSERAUTOSTART=1 => Status Ok
    DISABLENETWORKPROTOCOLS=0 => Status Ok

    Reply
  • Hi David!

    Try this:

    copy setup.ini %TEMP%\setup.ini
    setup.exe /settings %TEMP%\setup.ini /qb

    Reply
  • Hi,

    Could you please help?

    I am installing Sql Server 2008 Express in command prompt. The problem I have is that if there are any errors while its installing it puts it in the command prompt windows and then almost immediately closes the windows. How would I get the setup to show the error messages in a popup so let the user know wat the error is?

    Thanx in advanced,

    Reply
  • Hi Pinalkumar Dave,
    i downloaded the sqlexpress .exe from microsoft site. You are just supposed to open the .exe and install. However, i want a silent installation on the client machine, because my C# windows app depends on sqlexpress to run on local machine. Please how do i go about this?

    Reply
  • Hi,

    I was wondering if there is a way to install without having to log into the machine, hence not unattended instead no attended? I have seen unattended on all the installs for sql server but was wondering if there is a way to install without having to log into to run the script.

    Thanks.

    Reply
  • If i want to install the SQL2008 without user have to do anything but double click on the setup.bat file. I understand that I need to have the setup.ini. However i have no idea how to set the setup.ini file. Below are what I got from the net. I want to install the sql2008 with default instance only. Can you please teach me. Thanking you inadvance.

    Setup.exe /ConfigurationFile=MyConfigurationFile.INI

    Setup.exe /SQLSVCPASSWORD=”************” /AGTSVCPASSWORD=”************” /ASSVCPASSWORD=”************” /ISSVCPASSWORD=”************” /RSSVCPASSWORD=”************” /ConfigurationFile=MyConfigurationFile.INI

    Reply
  • hai,
    i getting error called “please go to control panel and install system components” while insatlling sielnt mode in Sql Server 2005 developer edition..

    Reply
  • but if we use the configuration file for the sql server installation. then how we trape the exit code or sql error message through dos console windows.

    please reply.

    Reply
  • Pinal,

    I had a question about SWITCH command in SQL Server. I have a Main table and Stage table identical to each other and i keep moving data from stage table into main table and want to use the SWITCH function, if i have a Identity column in both tables and if i move the data pages to the main table will the identity column set according to the main table?

    kishan

    Reply
  • Colleen Rossman
    October 8, 2011 12:48 am

    I am trying the /qb install using a config file but the setup is not using my config file and succeeds without installing SQL Server. Any ideas why it’s not using my connfig file ? Here’s the command I”m running
    ‘…setup.exe /qb /settings D:\install\sql.ini’

    Reply
  • Hi I installed SQL 2005 successfully as mentioned in your article. I created ini file as:

    [options]

    INSTANCENAME=MYINSTANCE
    ADDLOCAL=All
    SECURITYMODE=SQL
    SAPWD=sa#123
    DISABLENETWORKPROTOCOLS=0

    It successfully installed SQL server but SQL Command Line tool is missing from add/remove program. I have to install this manually. do you have any solution which can install SQLCMD too along with this setup.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.