Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-05-29 : 09:31:42
|
| Christopher writes "A better solution to this question...http://www.4guysfromrolla.com/webtech/sqlguru/q022400-1.shtml...is the one suggested by Microsoft at:http://www.microsoft.com/sql/using/tips/administration/casesensitive.aspQ. How can I program a case-sensitive comparison of a user-typed password on a case-insensitive SQL Server 7.0 instance?A. If you upgrade your system to SQL Server 2000, you can specify data collation down to the column level. (The SQL Server 2000 Books Online glossary defines collation as "a set of rules that determines how data is compared, ordered, and presented. Character data is sorted using collation information, including locale, sort order, and case-sensitivity.")However, until you upgrade to SQL Server 2000, you can use the following technique. Assume that the value of the password stored in your table is BamBi2000 (notice that the "B"s are uppercase, whereas all other letters are lowercase):DECLARE @user_password varchar(12)IF CAST (@user_password AS varbinary(12)) = CAST ('BamBi2000' AS varbinary(12))PRINT 'Password match' ELSEPRINT 'Password mismatch' —SQL Server MVPs" |
|
|
|
|
|