Rob Bamforth's Blog
Java, SQL, MySQL, Networking, SQL Server, PHP, COM, DBA + ODBC

SQL / T-SQL CASE SENSITIVE SELECT


A very simple method to force case sensitivity in a select statement:

SELECT * FROM DBusers WHERE username = ‘AGENT1′ AND password = ‘paSSworD’ COLLATE SQL_Latin1_General_Cp1_CS_AS


The above statement will only return rows where the password value is exactly paSSworD, case specific.


One Response to “SQL / T-SQL CASE SENSITIVE SELECT”

  1. Hey… this came in very handy for me today. Just wanted to say thanks.


Leave a Reply