SQL Server – Changing Sql Instance Collation – via sqlservr/-q


Reviewing SQL Server Alwayson requirements and as should be expected Collation Uniformity is needed (at the SQL Instance level).

Keep in mind not just at the database level, but at Instance level.


Curious as to the means to change Collation.

Familiar with doing so via re-running setup.exe.

UnDocumented Method

Was fascinated that there appears to be an undocumented route.  Let us see how dark that road is….




  1. Stop the SQL Server Instance
  2. Connect to the box using the Account SQL Server is running under or try runas
  3. Launch Cmd.exe in Administrator mode
  4. Start SQL instance using “ -m -T4022 -T3659  -q[COLLATION]


Actual Steps

Stop the SQL Instance


Ensure you are SQL Server Account

Ensure that you are running as the SQL Server Account.

To do so try the methods listed below:

  1. Logoff and Logon
  2. Issue “runas /user <username>


Launch Shell in Administrator Mode

Launch cmd.exe in Administrator Mode


Start SQL Server with needed parameters


You need the following parameters

  1. Trace Flags
    • T4022
      • Skip Start-up procedures
    • T3659
      • Writes all log to errorlog
  2. Command Line Arguments
    • -q
      • -q and collation


Sample Code

Change to United Kingdom [UK]


set _FLD="D:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn\"

rem United Kingdom
set "_COLLATION=Latin1_General_CI_AS"

%_FLD%\sqlservr -m -T4022 -q%_COLLATION% 


  1. -q “Latin1_General_CI_AS”
    • Targeted Collation is mentioned at command line
  2. Attempting to change default collation to <target collation>
    • Attempting to change default collation to Latin1_General_CI_AS
  3. Index Restored ….
    • Index Restored for various tables
  4. Default Collation was successfully changed


sqlservr.exe options

Again, this is undocumented.

If one goes into the SQL Server Binary folder and issue “sqlservr.exe /?“, one will not see the -q option.



See -q is not listed.



Crediting Douglas P. Castilho
Changing SQL Server Collation After Installation


Additional Reading

  1. Pieter Vanhove
    • -m Startup Parameter issues



  1. Database Engine Service Startup Options



Here are some follow-up posts:

  1. SQL Server – Changing Sql Instance Collation – via sqlservr/-q – Little Traps
    Date Added :- 2017-Jan-8th

2 thoughts on “SQL Server – Changing Sql Instance Collation – via sqlservr/-q

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google 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 )

Connecting to %s