What is the best way to check if a VARCHAR field has Non-Ascii Characters?
I tried using
PATINDEX and have run into the following issue.
Checking the lower range worked correctly.
SELECT * FROM mbrnotes WHERE PATINDEX('%[' + CHAR(1)+ '-' +CHAR(31)+']%',LINE_TEXT) > 0
My data had three records with 0x1E and all three where returned.
But when I check just the upper range:
SELECT * FROM mbrnotes WHERE PATINDEX('%[' + CHAR(127)+ '-' +CHAR(255)+']%',LINE_TEXT) > 0
It returns close to all the records in the table (table count 170737 and returned count 170735) and since my data did not have any values in this range I would think it should have returned no records.