Solved

how to select text depend on the localization

Posted on 2013-11-12
3
348 Views
Last Modified: 2013-11-17
Hi Experts
i have a table with one column that accept Arabic and English text for example some of the row have Arabic text and other rows have English text, is there any way in SQL or .net to view only Arabic text or the opposite way

thank you
0
Comment
Question by:AZZA-KHAMEES
3 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39641399
What kind of text appears in this field?  Sentences?  Abbreviations?  ...?

If the data is in sentence form or similar, using complete words, in English you are guaranteed to have at least one vowel (a,e,i,o,u), so you could try select statements like the following.

For English:

SELECT * FROM YourTable 
WHERE YourField LIKE '%a%' OR YourField LIKE '%e%' OR YourField LIKE '%i%' OR YourField LIKE '%o%' OR YourField LIKE '%u%'

Open in new window


And try the opposite to isolate Arabic records:

SELECT * FROM YourTable 
WHERE NOT (YourField LIKE '%a%' OR YourField LIKE '%e%' OR YourField LIKE '%i%' OR YourField LIKE '%o%' OR YourField LIKE '%u%')

Open in new window

0
 
LVL 4

Accepted Solution

by:
rshq earned 500 total points
ID: 39649019
Hi

  You can use ASCII , LTrim and RTrim function.
  In this code return only arabic column

 
Select  YourColumn from yourtable where 
            ASCII(substring(Ltrim(Rtrim(YourColumn)),1,1))>=194 and ASCII(substring(Ltrim(Rtrim(YourColumn)),1,1))<=246

Open in new window

0
 

Author Closing Comment

by:AZZA-KHAMEES
ID: 39654428
perfect
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question