Installing SQL Server 2005 Express via Command Line

There are a few ways to install SQL Server 2005: 1) From the UI or 2) Command-Line. The UI installation is cool, but deploying via command-line is (in my opinion) better, faster and more importantly consistent depending if you have all parameters specified in a batch file. There are technically two command-line options: 1) Pure Command-Line or 2) Command-Line with answer file.

pure command line

@echo off
color 17
Title SQL Server 2005 Express Unattended Install . . .
setup.exe /qb INSTANCENAME=DEV ADDLOCAL=SQL_Engine,SQL_Data_Files,SQL_Replication SECURITYMODE=SQL SAPWD=StrongPasswordGoesHere DISABLENETWORKPROTOCOLS=0 

command line with answer file

@echo off
color 17
Title SQL Server 2005 Express Unattended Install . . .
setup.exe /qb /settings "AnswerFile.ini"

answer file contents

[options]
INSTANCENAME=DEV
ADDLOCAL=SQL_Engine,SQL_Data_Files,SQL_Replication 
SECURITYMODE=SQL 
SAPWD=StrongPasswordGoesHere
DISABLENETWORKPROTOCOLS=0 

In both of the above examples notice that I am not specifying installation paths, data file paths, etc… So for any parameter that I did not supply a value for will automatically use their default values for each option not implicitly set. I only needed the basic necessities listed for my subscriber deployments.

For more information about additional parameters visit: How to: Install SQL Server 2005 from the Command Prompt

Advertisements

2 thoughts on “Installing SQL Server 2005 Express via Command Line

  1. Furqan says:

    Hi,
    I tried your give method, it did not return any errors but did not isntall anything too……
    Do we need to put parameters in quotations?

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