Comparison | case
Q: How do I write a program that can compare the case of a user's password in a case-insensitive instance of SQL Server 7.0?
A. If you have upgraded your system to SQL Server 2000, you can specify the collation of the data at the column level. (The SQL Server Books Online glossary defines collations as a set of rules that determine how to compare, arrange, and render data.) Character data is stored using collations, including locale, sorting criteria, and case sensitivity. )
However, you can use this technique only if you are upgrading to SQL Server 2000. Suppose the password value stored in the table is BamBi2000 (Note that "B" is uppercase and all other characters are lowercase):
DECLARE @user_password varchar (12)
IF CAST (@user_password as varbinary (12)) =
CAST (' BamBi2000 ' as varbinary (12))
PRINT ' Password match '
ELSE
PRINT ' Password mismatch '
-sql Server MVPs