guys i need a small help on SQL Query.
I want to write a SELECT query which gives me CASE SENSITIVE search result. for ex: if a users original password in db is 'TOM' and user while logging in enters his password as 'tom', he should not be able to login ..But if he enters the password as 'TOM' he is permitted to log in .. How do i check this using a SQL Select Query ?
Any idea on this would be greatly appreciated..
NimeshUsing the PUBS database as an example, I have SQL Server installed as case insensitive. I can write a query to return the Author 'Green' from the AUTHORS table as:
select *
from authors
where au_lname = 'green'
Which would return 1 record even if the lastname is 'Green' with a capital letter. However if I want to enforce case sensitive I would convert the values to VARBINARY. The following would not return a record:
select *
from authors
where convert(varbinary,au_lname) = convert(varbinary,'green')
However this would return 1 record:
select *
from authors
where convert(varbinary,au_lname) = convert(varbinary,'Green')
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment