Case sensative strings in SQL Server / ADO.NET

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
 
A

Adam Machanic

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
 
A

Adam Machanic

Adam Machanic said:
Change the password column's collation to something case insensitive... For
instance:

Sorry, that should have read "case sensitive".
 
B

Brian Henry

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!
 
A

Adam Machanic

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.
 
B

Brian Henry

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top