Click here to Skip to main content
15,868,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i have a table name tblUsers with following fields

UserName(varchar, Primary Key)
FullName(varchar)
Address(varchar)
etc

when i search data for a particular user using vb.net. SqlServer do not exactly match "upper case letters" for the UserName.

UserName 'miang' and 'MianG' gives the same result. Where as i want that SqlServer must exactly match the whole string including caps.

Please help me


Thankx
Posted

1 solution

As indicated by this article, you can perform a case-sensitive search with any of the following techniques: convert to a binary data type, use COLLATE to specify the case sensitivity, as well as a few other options. For better performance without having to change your table or create a view, I'd perform a case-insensitive search, then filter those results using COLLATE or binary conversion to get rid of invalid results.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900