0% found this document useful (0 votes)
17 views3 pages

Change SQL Server Collation

Uploaded by

Priyank Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Change SQL Server Collation

Uploaded by

Priyank Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Change SQL Server Collation

The first thing to do is to confirm the collation we have set.

We can see from these results that indeed


the collation is wrong and we need to change it in order to comply with the request from the
vendor. Next we will need to stop the SQL Server services.

I think that is pretty clear there what to do. As a reminder, the preferred method to stop and
start SQL Server services is via the SQL Server Configuration Manager. We won’t do every
start/stop from here for this article for good reason.

Once the services are stopped, then we need to open an administrative command prompt and
navigate to the SQL Server binn directory as shown here.
This is for a default instance on SQL Server 2017. If you have a named instance or a different
version of SQL Server, you will need to navigate the instance folder structure for your instance.

Next is where the magic happens. We enter a command similar to this:

1 sqlservr -m -T4022 -T3659 -q"SQL_Latin1_General_CP850_CS_AS"

Here is a quick summary of those flags in this command:

[-m] single user admin mode


[-T] trace flag turned on at startup
[-q] new collation to be applied

There are more such as -s available in books online for your perusal.

If you are curious what is up with those Trace Flags, pretty simple. TF4022 is to bypass startup
procs. TF3659 on the other hand is supposed to write errors to the error log (at least in theory).

When the script starts, you will see something like the next two screens:
In the first, you can see that it says it is attempting to change the collation. In the second, just
before the completion message, it states that the default collation was successfully changed.

You might also like