Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2010
    Posts
    2

    Unanswered: Hindi text in nText column SQL Server 2005

    We are using SQL Server 2005, and saving Hindi, English, Japaneese, Chiness languages in nText column.
    This all we are doing using google analytical. However, we don't know how to know which value is Hindi or Englsh as they are encoded.

    Please suggest how to write a query to know the count for all the rows having Hindi text.

    Pawan Garg

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Provided no ntext value (and you should probably change that to nvarchar(max)) has multiple languages, you could try to judge which unicode range the first non whitespace character comes from. It will take me a few minutes to come up with an example, but you should be able to tell what ranges each characterset occupies in the unicode standard.

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Something like this should work out:
    Code:
    select case when unicode(substring (ntextcolumn, 1, 1)) < 255 then 'English'
        when unicode(substring (ntextcolumn, 1, 1)) < 3000 then 'Hindi' end
    from yourtable
    Like I said before, you will need to adjust the values and order of checks to make sure you get the right results. You will also need to make sure you get the first non-whitespace character.

  4. #4
    Join Date
    Feb 2010
    Posts
    2
    How can we find the range for any specific language against a Unicode value... Please suggest

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Well, you could look for the Unicode Code charts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •