Find lower case in case-insensitive SQL

To find lowercase values in a case insensitive database run the following query:

SELECT *
FROM Values
CONVERT(varbinary(12), UPPER(Value)) != CONVERT(varbinary(12), Value)

It converts the values to binary first before they are compared.

This entry was posted in At the office. Bookmark the permalink.