Tuesday, January 15, 2013

How to change SQL Server collation after installation?


Once SQL Server is installed the selected collation setting applies to all system databases. For user databases collation can be changed after database is created but for all system databases it remains the same as the one selected during SQL Server installation. There are two ways to do it. First is to reinstall and second is to rebuild system databases

Following command can be used to rebuild

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=TESTSERVER\administrator /SAPWD=SA_password /SQLCOLLATION=Latin1_General_CI_AS