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
Good tip, thanks for sharing
ReplyDeleteDave
http://eMarkethosting.com
ReplyDeleteVery Useful information that i have found. don't stop sharing and Please keep updating us..... Thanks
This is an best post. It is Really very informative concept.I like it and help me to development very well.Thanks alot for this brief explanation and very nice information.BEST SQl Server Training In Hyderabad
ReplyDeletethank your valuable content.we are very thankful to you.one of the recommanded blog.which is very useful to new learners and professionals.content is very useful for hadoop learners
ReplyDeleteBest Spring Classroom Training Institute
Best Devops Classroom Training Institute
Best Corejava Classroom Training Institute
Best Oracle Classroom Training Institute
Best Oracle Classroom Training Institute
Thanks For Sharing The Information The Information Shared Is Very Valuable Please Keep Updating Us Time Just Went On Reading The article sql server Online Course
ReplyDeleteHere Informative Contents are solved all My Queries...This Resource is Really Helpful For My Reference.Thanks for Being a parts for support People to Build their Careers...
ReplyDeleteJava training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery