0

The default language on my database is set to SQL_Latin1_General_CP1_CI_AS.

I'm looking to return results where the name field contains characters from another language, such as Arabic or Chinese):

Albra اابومحمد

I've tried the following pieces of code below in my WHERE clause, but the result set is always empty:

  1. a.Name NOT LIKE '%[^A-z]%'
  2. PATINDEX('%[A-Z,0-9]%',a.Name) > 0

  3. ASCII(a.Name) NOT BETWEEN 65/* A */ and 90/* Z */ AND ASCII(a.Name) NOT BETWEEN 97 /* a */ AND 122 /* z */

  4. a.Name COLLATE SQL_Latin1_General_CP1_CI_AS NOT LIKE '%[^0-9a-zA-Z]%'

Update

I'm using SQL Server 2012 (not SQL Server 2005.) I tried the code in the accepted answer to "how to select rows that contains non-english characters in sql server 2005(it should filter only non-english chars, not special characters)" but it does not work on my database.

Community
  • 1
  • 1
user4637035
  • 23
  • 1
  • 2
  • 6
  • (1) When you say 'to no avail' what were the actual results? (2) Did you already populate the name column with non-Latin strings? Are you trying to do a select or an update query? – dcorking Dec 04 '15 at 15:57
  • Trying to do a SQL select. Just trying to identify data that would be included in this result set. By no avail, I mean I didn't get what I was looking for. I setup a dummy name listed above that I wanted in the result set. All I got was a return on Null records or records that had a character outside of A-Z... – user4637035 Dec 04 '15 at 16:19
  • Possible duplicate of [how to select rows that contains non-english characters without including special characters in sql server 2005](http://stackoverflow.com/questions/21139258/how-to-select-rows-that-contains-non-english-characters-without-including-specia) – AHiggins Dec 04 '15 at 17:48
  • This is not a duplicate. I'm using SQL Server 2012, and I already tried the function in the link provided and it does not work. Any other suggestions? – user4637035 Dec 04 '15 at 18:43
  • Please add the error messages and result sets to your question: don't make it hard for answerers to find them in comments. When you say: "The link that identified as a possible duplicate was explored prior to this posting and does not work", what happened when it did not work. Also, I suggest making a minimal database that reproduces your problem, so that others can try it. – dcorking Dec 06 '15 at 11:57

0 Answers0