Microsoft SQL Server

There exsist a traditional Chinese and a simplified Chinese version of Microsofts SQL Server.

Install
During the install one can choose the 'Collation designator' and the sort order for the chosen designator. For the Chinese language one can choose between Chinese_PRC, Chinese_PRC_stroke, Chinese_Taiwan_bopomofo, Chinese_Taiwan_stroke.

Usage
The mean trick is using N. Watch the following examples:

For each login one can specify the default language and database.
Use NVARCHAR instead of VARCHAR

Since SQL Server 7.0 and 2000 support both Unicode and non-Unicode data types, they require you to use the "N" prefix in front of Unicode string literals. Even though ADO is sending the query as Unicode text (since all COM automation components have Unicode interfaces), SQL Server believes that the string literal 'New Text' is supposed to be on the default system code page (CP_ACP) and it converts it to that code page. Then, upon inserting the text to an NTEXT column, SQL Server converts it back to Unicode using CP_ACP. This causes a slight performance hit for the query because of the two extra conversions, but it also causes strings to be corrupted if they are not on your server's default system code page. So the following code is WRONG :
UPDATE Table1 SET Col1 = 'New Text' WHERE id = 1000
and should be replaced by this one :
UPDATE Table1 SET Col1 = N'New Text' WHERE id = 1000

INF: Storing UTF-8 Date in SQL Server

[ < back ] - [ home ]

   
Search >


Local links are in blue, links to other websites are in red, commands are in green.

You need unicode fonts, a 4+ browser and acrobat reader to fully explore and enjoy this webpage. (if necessary you can download asian fontpacks for acrobat reader)

Currently translating my thesis to English : more info

© Seba - contact at seba at ulyssis dot org
users online: 2