Installing MSSQL server with standard setup
Sometimes when you are installing the MSSQL Express, you will found out that you missed out changing the collation, change the instance name and other standard settings for the programs that you are distributing.
To avoid patching the SQL server settings, it's better to use a script and all team members to follow. Here is the script that I have came out to setup the MSSQL. The most frequent updating the setting is the collation ... we forgot to change it to our standard before hitting Continue button.
$sql_setup_file = "F:\my-setupFiles\sql2012 express\SQLEXPRWT_x64_ENU.exe "
$db_dir = "F:\my_database"
$bak_dir = "F:\my_database_backup"
$sa_pwd = "1234567890"
$param = "/QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=""install"" /FEATURES=SQL,Tools /INSTANCENAME=sqlexpress /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS /ERRORREPORTING=0 /SQLBACKUPDIR=""$bak_dir"" /SQLUSERDBDIR=""$db_dir"" /TCPENABLED=1 /INDICATEPROGRESS /SECURITYMODE=SQL /SAPWD=""$sa_pwd"""
Write-Host "Installing SQL server... please wait.."
#start the installation.
Start-Process -FilePath $sql_setup_file -ArgumentList $param -Wait
Write-Host "SQL installation completed"
To avoid patching the SQL server settings, it's better to use a script and all team members to follow. Here is the script that I have came out to setup the MSSQL. The most frequent updating the setting is the collation ... we forgot to change it to our standard before hitting Continue button.
$sql_setup_file = "F:\my-setupFiles\sql2012 express\SQLEXPRWT_x64_ENU.exe "
$db_dir = "F:\my_database"
$bak_dir = "F:\my_database_backup"
$sa_pwd = "1234567890"
$param = "/QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=""install"" /FEATURES=SQL,Tools /INSTANCENAME=sqlexpress /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS /ERRORREPORTING=0 /SQLBACKUPDIR=""$bak_dir"" /SQLUSERDBDIR=""$db_dir"" /TCPENABLED=1 /INDICATEPROGRESS /SECURITYMODE=SQL /SAPWD=""$sa_pwd"""
Write-Host "Installing SQL server... please wait.."
#start the installation.
Start-Process -FilePath $sql_setup_file -ArgumentList $param -Wait
Write-Host "SQL installation completed"
Comments
Post a Comment