While Setting Up Microsoft SQL Server 2008, you may find out that you have missed setting up the SQL Server Instance Character Set. this is so common as the SQL Server Setup procedure may not highlight the area of changing the character set the way you expected, so you will end up using the default character set, which is "Latin1_General_CI_AS".
So if you are in the situation where you want to change the character set immediately after the setup completion, the only 2 options you have are:
1- Uninstall/Reinstall the SQL Server Software, and select the desired character set during the setup.
2- run a command line script to change the character set at the SQL server instance level.
in this article, we will use option 2 above, which is running the command that allows you to change the character set, as follows:
Determine which character set you need to set:
Open SQL Server Management Studio --> New Query and run the following command against the master database:
select * from fn_helpcollations()
the above query will list all the available character sets, so you need to choose one of them, in this example, I am going to choose "Arabic_CI_AI".
Execute the command that changes the character set
open command prompt, go to the directory where you have the SQL Server 2008 setup files, you will need to choose the directory that contains "Setup.exe"
then, type in the following command:
setup.exe /q /ACTION=RebuildDatabase /INSTANCENAME=MSSQLSERVER /SAPWD="password"
/SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" /SqlCollation=Arabic_CI_AI
Note: the above line should be a straight line with no carriage returns. You need to change the values in green with values that represents your SQL environment, mainly you need to change the Instance Name, "sa" account password and the SQL Collation Name (that you have chosen in the previous step)
execute the command, wait until it finishes executing, then , if there is no errors or validation notes, the character set will be changed as desired.
Important Note: the above procedure is for changing the collation/character set at a fresh installation of SQL Server 2008. if you already have created some custom databases and that these databases contains data, then you will have to run through a very detailed/complex procedure to change the collation.
the following article is very useful for such a case: