Chorn Sokun's Weblog

Conquer inner fear, push it to the limit!

Khmer Collation support in SQL Server 2008

leave a comment »

SQL Server ’08 using default collation as “SQL_Latin1_General_CP1_CI_AS” which most/all of us knew that

  • We can store Khmer Unicode (with NVARCHAR, NText etc)
  • Searching Khmer Unicode ? suck !

There are work around if you really want to search content in Khmer Unicode after you stored it; using SQL Server ’08 default collation. How?

Method #1: Try to break each word using hidden space

Method #2: Encoding incoming Khmer Unicode content and stored it as ASCI

It works but it hurt; there is an althernative SQL Server ’08 introduce a few additional collation algorithm among those “Khmer_100” is one of them.

Khmer Collation in SQL Server 2008

That awesome all you have to do is changing your column collation from <default collation> to “Windows Collation -> Khmer_100” that’s it no code isn’t that cool ?

No it’s not cool, It only works if SQL Server install on Windows Vista or Higher.

Edit: actually we can also use this

Advertisements

Written by Chorn Sokun

July 28, 2010 at 10:48 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: