Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Unattended MSSQL 2005 Installation – Command Line Installation of MSSQL  (Read 2614 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest
Unattended MSSQL 2005 Installation – Command Line Installation of MSSQL


Microsoft SQL Server is a relational model database server produced by Microsoft and it’s Installation is quite Easy using GUI where a user has to selects the options which he/she needs with the database server and install it. We can automate the installation procedure and make it so simple that MSSQL can be installed using a single command.

Automating SQL server installation is made easier in MSSQL 2005 version and we can define the components which need to be installed with setup.exe via command prompt OR we can create an ini file which will contain all the information about the installation. In this post I will explain the steps to install MSSQL 2005 using command prompt with the help of single command.

Install MSSQL using Command Prompt (By Defining all modules in command)

1) Insert the MSSQL installation media into the disk drive.

2) Open Command Prompt (Start >> Run >> cmd >> Enter)

3) Execute following command

Start /wait [CD or DVD Drive]serverssetup.exe /qb INSTANCENAME=[InstanceName] ADDLOCAL=All PIDKEY=[pidkey value with no "-"] SAPWD=[StrongPassword] SQLACCOUNT=[domainuser] SQLPASSWORD=[DomainUserPassword] AGTACCOUNT=[domainuser] AGTPASSWORD=[DomainUserPassword] SQLBROWSERACCOUNT=[domainuser] SQLBROWSERPASSWORD=[DomainUserPassword]


Here, ADDLOCAL is set to “All” which will install all the components and modules bundled with the MSSQL. If you want customized modules then you can declare the modules instead of “All“.

Install MSSQL using .ini file

1) Open Notepad (Start >> Run >> Notepad >> Enter)

2) Insert all the “Installation Parameters” in that file. Following is the sample file which I have used to install MSSQL on my System

[Options]
USERNAME=USER
COMPANYNAME=USER
PIDKEY=1234657979764346
INSTALLSQLDIR=D:MSSQL
ADDLOCAL=SQL_Engine,SQL_Replication,Client_Components,Connectivity,SQLXML
SECURITYMODE=SQL
SAPWD=Supp0rt
SQLACCOUNT=”NT AUTHORITYSYSTEM”
AGTACCOUNT=”NT AUTHORITYSYSTEM”
SQLBROWSERACCOUNT=”NT AUTHORITYSYSTEM”
SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS


Here, PIDKEY will be the Product Key of the product shipped with MSSQL.

3) Save this file with extension .ini (like sqlsetup.ini)

4) Execute following command to run the setup
[CD or DVD Drive]/servers/setup.exe /settings [path to setup file]sqlsetup.ini /qb


Points to Note:

1) While specifying the accounts like SQLACCOUNT, AGTACCOUNT and SQLBROWSERACCOUNT make sure you define proper users. Users can be

Domain User account     : [domainuser]
Local System Account    : “NT AUTHORITYSYSTEM”
Network Service Account : “NT AUTHORITYNETWORK SERVICE”
Local Service Account   : “NT AUTHORITYLOCAL SERVICE”

2) Microsoft provides a template.ini file in the installation media but I would strongly recommend to remove the options that you don’t want.