Case sensative strings in SQL Server / ADO.NET

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

I am trying to implement a case sensative password (plain text) so something
like PaSsWoRd123 would not be the same as passWORD123... but simple select
statements in SQL Server 2000 match them as the same when you say something
like select count (*) from users where username = @username and password =
@password... I am using ADO.NET to issue the commands to sql server, but it
seems like sql server is doing the uncase senstaive matching... how would
you go about doing case senstavie matching on ths column? thanks
 
Change the password column's collation to something case insensitive... For
instance:


ALTER TABLE YourTable
ALTER COLUMN YourPasswordCol VARCHAR(15) COLLATE
SQL_Latin1_General_CP1_CS_AS NOT NULL
 
Hi Adam, I noticed the CP1 CS tags on that, I am assumeing CS stands for
case sensative? what does CP1 stand for? all i can think of is code page 1
but not sure if that is correct.. thanks for clearning this up for me!
 
Brian Henry said:
Hi Adam, I noticed the CP1 CS tags on that, I am assumeing CS stands for
case sensative? what does CP1 stand for? all i can think of is code page 1
but not sure if that is correct.. thanks for clearning this up for me!

SQL_Latin1_General_CP1_CS_AS

CP1 actually represents Code Page 1252 !

The other two make more sense: CS = Case Sensitive, and AS = Accent
Sensitive.
 
ah thanks!

Adam Machanic said:
SQL_Latin1_General_CP1_CS_AS

CP1 actually represents Code Page 1252 !

The other two make more sense: CS = Case Sensitive, and AS = Accent
Sensitive.
 
Back
Top