Note: Do not make any changes in production without proper testing in Dev/Test environment.
The server collation acts as the default collation for all system databases that are installed with the instance of SQL Server, and also any newly created user databases.
To change the default SQL Server collation you can simply rebuild the system databases. When you rebuild the master, the model, msdb and tempdb system database are actually dropped and recreated in their original location. If a new collation is specified in the rebuild statement the system databases are rebuilt using that collation setting. Any user modifications to these databases will be lost, so it is important to backup any of this information you wish to retain. For example, you may have user-defined objects in the master database, scheduled jobs in msdb, or changes to the default database settings in the model database.
Steps to change server level collation of a given SQL Server Instance
Step 1:
First check the existing SQL Server collation setting of your instance. Run the command below to get the collation value of your SQL Server instance.
SELECT SERVERPROPERTY(N'Collation') --SQL_Latin1_General_CP1_CI_AI
Step 2:
Make note of all server level settings before rebuilding the system databases to ensure that you can restore the system databases to their current settings.
SELECT * FROM sys.configurations;
-- OR
EXEC SP_CONFIGURE
Step 3:
Create and prepare all scripts related to jobs, maintenance plans, logins and their access levels.
Step 4:
Detach or take backup of all user databases before rebuilding your system databases. If you leave databases attached they will be detached and will be found in the database folder.
Step 5:
Change directory to the Installation Media location.
C:\Program Files (x86)\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012
Run the following syntax from the folder location.Replace the Instance name, accounts, Strong password & collation name accordingly.
C:\Program Files (x86)\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012>Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=instancename /SQLSYSADMINACCOUNTS= sql /admin SAPWD= sapassword /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS
Once the rebuild operation is complete, check the server collation to verify whether this change is successful or not.
SELECT SERVERPROPERTY(N'Collation')
--SQL_Latin1_General_CP1_CI_AS
The server collation acts as the default collation for all system databases that are installed with the instance of SQL Server, and also any newly created user databases.
To change the default SQL Server collation you can simply rebuild the system databases. When you rebuild the master, the model, msdb and tempdb system database are actually dropped and recreated in their original location. If a new collation is specified in the rebuild statement the system databases are rebuilt using that collation setting. Any user modifications to these databases will be lost, so it is important to backup any of this information you wish to retain. For example, you may have user-defined objects in the master database, scheduled jobs in msdb, or changes to the default database settings in the model database.
Steps to change server level collation of a given SQL Server Instance
Step 1:
First check the existing SQL Server collation setting of your instance. Run the command below to get the collation value of your SQL Server instance.
SELECT SERVERPROPERTY(N'Collation') --SQL_Latin1_General_CP1_CI_AI
Step 2:
Make note of all server level settings before rebuilding the system databases to ensure that you can restore the system databases to their current settings.
SELECT * FROM sys.configurations;
-- OR
EXEC SP_CONFIGURE
Step 3:
Create and prepare all scripts related to jobs, maintenance plans, logins and their access levels.
Step 4:
Detach or take backup of all user databases before rebuilding your system databases. If you leave databases attached they will be detached and will be found in the database folder.
Step 5:
Change directory to the Installation Media location.
C:\Program Files (x86)\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012
Run the following syntax from the folder location.Replace the Instance name, accounts, Strong password & collation name accordingly.
C:\Program Files (x86)\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012>Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=instancename /SQLSYSADMINACCOUNTS= sql /admin SAPWD= sapassword /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS
Once the rebuild operation is complete, check the server collation to verify whether this change is successful or not.
SELECT SERVERPROPERTY(N'Collation')
--SQL_Latin1_General_CP1_CI_AS