In particular, Sql Server 2005 / T-Sql. I have a field, basically it is a series of two characters, and they should all be in upper case, but there is some outdated data that precedes the current database / system, and I need to find out which records violate the upper binding of the covenant.
I thought this would work:
select * from tbl where ascii(field1) <> ascii(upper(field1))
And indeed, it returned me a few notes. Since then, they have been fixed, and now this query does not return data. But I have people who tell me that there is still mixed data in the database, and I just found an example: “FS” and “Fs” report the same ascii value.
Why is this approach wrong? What is better for this, or how can I fix this approach to work properly?
source
share