Tuesday, March 2, 2010

SQL Query case sensitive

How to make the case sensitive query?
There are 2 records in the database with currAbbr = ZAR and ZAr, in order to get the correct case sensitive comparision, u can use BINARY_CHECKSUM.

try this query:
select * from MYTable
where BINARY_CHECKSUM(currAbbr) = BINARY_CHECKSUM('ZAR')
select * from MYTable
where BINARY_CHECKSUM(currAbbr) = BINARY_CHECKSUM('ZAr')

No comments: