Solved

how to select text depend on the localization

Posted on 2013-11-12
3
349 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 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