Change SQL Server Collation on an Azure VM

Microsoft Azure has a very nice set of VM templates to have you going fast when provisioning new machines including pre-configured SQL Servers.

image


Unfortunately those SQL Server templates come with the default “SQL_Latin1_General_CP1_CI_AS” collation when created.

If you’re used to building SharePoint Server infrastructures you probably know that SharePoint will require using “Latin1General_CI_AS_KS_WS”, so in order to use the stock VM template you must change the collation.

Chance is that this operation is pretty simple according to documentation https://docs.microsoft.com/en-us/sql/relational-databases/collations/set-or-change-the-server-collation


On Azure SQL Server VM Templates the setup media can be found en the “C:\” drive, on my SQL 2016 example it is under “C:\SQLServerFull\”.

image


Here are the steps:

(Remember that if you have existing data you’ll have to backup before proceeding)

1) Loggon to the server with the SQL admin account, in my case I use the local admin account “sqladmin” that was created with my fresh VM


2) Open a command promp and navigate to the sql installation media “C:\SQLServerFull\”


2) Run the following command


Setup /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLCOLLATION=Latin1General_CI_AS_KS_WS /SQLSYSADMINACCOUNTS=sqladmin


image


And “VoilĂ ” it’s done:

image

Comments