Q:

In SQL Server, select char(1) 'A' and not 'a'

I am using SQL Server 2008 R2.
I have a table that has a column of datatype char(1).
In the table the use of 'A' has one meaning while 'a' has a different meaning.
How do I query for only 'A' and not receive values of 'a'?
I have searched and found on MSDN and looked on W3Schools. I was unable to change to suit my purpose.
Thanks

A:

It happens because SQL Server is case insensitive from default.
Add "COLLATE Latin1_General_CS_AS" to your query:
SELECT * FROM tableName WHERE columnName = 'a' COLLATE Latin1_General_CS_AS

or change definition of column in your table:
ALTER TABLE tableName
ALTER COLUMN columnName CHAR(1)
COLLATE SQL_Latin1_General_CP1_CS_AS

