Showing posts with label Case sensitive column contents in SqlServer. Show all posts
Showing posts with label Case sensitive column contents in SqlServer. Show all posts

Tuesday, March 16, 2010

Case sensitive column contents in SqlServer

Use the following t-sql code to make the contents of a column case sensitive regardless of the default db setting:

alter table TheTableName alter column TheColumnName TypeOfColEgVarchar(20)OrChar(6) collate Latin1_General_CS_AS

for example:
alter table People alter column LastName varchar(20) collate Latin1_General_CS_AS

Am using this in SqlServer 2005.