Monday, June 18, 2012

SQL Server - Case Sensitive Search

By Default SQL Server search database Irrespective of case of the data in order to make it search with respect to the case of the data we need to set COLLATE identifier to "Latin1_General_CS_AS" of the field you want to make case sensitive like shown below.

ALTER TABLE mytable 
    ALTER COLUMN mycolumn VARCHAR(10) 
    COLLATE Latin1_General_CS_AS 
GO 

No comments:

Post a Comment