Case Sensitive Query on a Case Insensitive Column in SQL Server

In this example we will use the following table with one case insensitive column:


When we query data from a case insensitive (CI) table column in SQL Server, we get the result where upper case, lower case and mixed case strings are returned:

SELECT * FROM cs_test
WHERE Text = 'Abc'


To do a case sensitive (CS) search on a case insensitive table column, use the following query:

SELECT * FROM cs_test
WHERE Text COLLATE SQL_Latin1_General_CP1_CS_AS = 'Abc'


Column can be made case sensitive when table is designed, using the following query:
CREATE TABLE cs_test (Text nvarchar(50) COLLATE SQL_Latin1_General_CP1_CS_AS)

Querying a column that was designed as case sensitive will be case sensitive: