HumanJHawkins (JHawkins (AT) Locutius (DOT) Com) writes:
Quote:
I need to find records where a text (and/or varchar) field contains
extended characters. If I knew particular extended characters, I could
do something like this:
select * from TableName where charindex('-',vchitem)<>0 or charindex
('',vchitem)<>0
But I do not know what extended characters might be in the field, so I
need to do something like looking for text that contains an ASCII
value greater than 127 for example.
Can anyone think of how to do this? |
patindex('%[' + char(127) + '-' + char(255) + ']%',
col COLLATE Latin1_General_BIN2)
That is, by forcing a binary collection, you can use a range pattern.
--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx