Case sensitive compare | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Case sensitive compare

One of our client apps stores a 3 letter code to uniquely identify its records (not great, but its legacy stuff and cant be changed now). Since ‘ZZZ’ has now been exceeded, it needs to be able to start acting case sensitive.
Is there anyway to have a case sensitive compare on a non case sensitive server. We cannot change the server. I was thinking by converting both the field, and the search string to varbinary and then comparing those, it might not be able to act insensitively, but this appears to return no rows whatsoever. Any ideas please?

Varbinary should work. Example in pubs db:
SELECT * FROM authors
WHERE CAST(au_lname AS VARBINARY(255)) = CAST(‘White’ AS VARBINARY(255)) SELECT * FROM authors
WHERE CAST(au_lname AS VARBINARY(255)) = CAST(‘white’ AS VARBINARY(255)) /Argyle
Not sure what I was doing wrong exactly, but your example works fine <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Thanks Argyle.
]]>