Case-sensitive / Case-Insensitivegreenspun.com : LUSENET : SQL Server Database Administration : One Thread
SQL 7 allows data to be stored case-insensitive; when i search i don't have to use uppers or downers everywhere.
however, for usernames and passwords, is there a way to FORCE a case-sensitive comparison?
------- SELECT * FROM Users WHERE Username = "some_value" AND Password = "some_other_value" -------
-- Anonymous, July 21, 1999
Before doing a comparison, convert each of the operands to binary.
if ('Aa' = 'aa') print 'True' else print 'False'
prints True, whereas:
if (convert (binary, 'Aa') = convert (binary, 'aa')) print 'True' else print 'False'
Hope this helps,
-- Anonymous, July 28, 1999