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.

No comments:

Post a Comment