berkshirea
Technical User
hi guys, can you help me out here please.
i am testing a simple login page.
i have a table something like this:
id firstname surname
1 freddie green
2 John West
3 marvin jackson
4 Adam Smith
5 Stephen Lamb
i want to return results of everything id=4 and greater and that are case sensitive. so far i have written this sql:
select * from myTable where firstname = 'firstname' and surname = 'surname' COLLATE Latin1_General_CS_AS
and this sql above returns everything from id=4 and greater and stricter in that it should only be of the right case.
BUT i want also to include the old ones, id=3 and less, which includes the results from non-case-sensitive login.
i was trying the dynamic where clause using 'case' but am not successful.
i hope i've explained what i want to convey clearly.
any ideas?
i am testing a simple login page.
i have a table something like this:
id firstname surname
1 freddie green
2 John West
3 marvin jackson
4 Adam Smith
5 Stephen Lamb
i want to return results of everything id=4 and greater and that are case sensitive. so far i have written this sql:
select * from myTable where firstname = 'firstname' and surname = 'surname' COLLATE Latin1_General_CS_AS
and this sql above returns everything from id=4 and greater and stricter in that it should only be of the right case.
BUT i want also to include the old ones, id=3 and less, which includes the results from non-case-sensitive login.
i was trying the dynamic where clause using 'case' but am not successful.
i hope i've explained what i want to convey clearly.
any ideas?