Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Hello!Is there a way to enforce exact case matching when querying SQL Server without having to change the case-sensitivity on the server?I want to ensure that a user name and password supplied match even at the case level, much like NT/2000 does for user accounts. For instance: username - kheon password - passSupplied in login form: username - kheon password - pass result - successSupplied in login form: username - KHeon password - Pass result - failureIs there a built-in function I can use to do this?Thanks in advance!Kyle HeonPixelMEDIA, Inc.Senior Application Programmer, MCPkheon@pixelmedia.com
Page47
Master Smack Fu Yak Hacker
2878 Posts
Posted - 2002-10-11 : 09:44:03
If you convert to a varbinary you should be able to specify an exact match ...
select 'match'from <yourtable>where convert(varbinary,username) = convert(varbinary,@username) and convert(varbinary,password) = convert(varbinary,@password)
Page47 -Thanks, that appears to do the trick. I have hashed passwords in the database so I'll have to do some editing to my sprocs to ensure that everything works but a quick test appears to work fine.Thanks again!Kyle HeonPixelMEDIA, Inc.Senior Application Programmer, MCPkheon@pixelmedia.com