question

prasad.nyalapatla avatar image
prasad.nyalapatla asked

Translate data from chiness language to english

hi, we had maintain client data in chiness language(some columns date like username, address..,.). example table lineid UserName Type 3 曹书魁 Server 4 侯瑞祥 Manager now, we want to display username in english using query. is it possible in sql server 2008 r2 please help me.
t-sql
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

prasad.nyalapatla avatar image prasad.nyalapatla commented ·
thanks usman and pavel
0 Likes 0 ·

1 Answer

·
Pavel Pawlowski avatar image
Pavel Pawlowski answered
SQL Server doesn't provide any direct translation API so you will have to use some external translation service. The best place where to handle this using an external translation service will be GUI as the calls to the translation service will not slowdown the queries and you can translate only the displayed names. Also it could be possible to do this directly in the query eg. using CLR Scalar function. This function can take the chinese text and call some translation service and return the translated text. However as I have mentioned this will have drastical impact on the SQL Server performance especially on large datasets.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Usman Butt avatar image Usman Butt commented ·
I totally agree with Pavel. Just a thought, in terms of TSQL, it might be possible (or might not be), if you can map the Chinese characters UNICODEs against the English characters in a separate table. For e.g. UNICODE(曹) = 26361 is mapped to 'A', UNICODE(书) = 20070 is mapped to 'B' etc. and then you may show the English Characters against them. But why to reinvent the wheel when you have translation add-ons on the web. Most importantly, beware that you could be sued for wrong interpretation if someone finds it offensive ;) So be careful in such client name conversions.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.