Recognising Japanese text present in a SQL server table through SQL query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shivangi04
    New Member
    • Jan 2014
    • 1

    #1

    Recognising Japanese text present in a SQL server table through SQL query

    I have a SQL table that contains columns that have text in Japanese language. The format of the column is nvarchar. I am trying write a SQL query that populates another column of the same table with certain numbers in in case in the Japanese text is, for eg, this - バッテリ.
    How do I write the query?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    If you are talking about katakana or hiragana, look up the range in the unicode table that corresponds to those characters and look for any characters in that range with wildcards around it. If you need to find kanji, then you will need to look up the CJK range but you won't be able to make the distinction between whether or not it is Chinese, Japanese, or Korean. That's impossible to do because it would be like asking whether "a" is English, French, German, Spanish, etc.

    So for example, if I wanted to find anything with a character in the english alphabet, I would use:
    Code:
    SELECT field
    FROM table
    WHERE field LIKE '%[a-z]%'
    You just need to replace a-z with the correct range in unicode, where a is the first character in the range and z is the last character. You may need to include multiple ranges if they're broken up and not contiguous.

    Comment

    Working...