Sunday, June 30, 2013

How to get ASCII values for THAI Characters using T SQL ??

The character you mention is not an ASCII symbol; it is not in the original 127 characters, nor is it in the extended table (see http://www.asciitable.com/).


So you need to use a unicode data type, such as nvarchar.


It is essential to use an nvarchar data type in which you import the data, because if you import into a "regular" varchar, the unicode information is lost.


After that, you can use the UNICODE() function on a symbol to determine its unicode value.


Alternatively, you can convert the nvarchar value to varchar and back and compare it to the original value. If it has changed, then the value contained at least one non-ASCII character.




Gert-Jan


No comments:

Post a Comment