与上限完全匹配 [英] Exact Match with Caps

查看:119
本文介绍了与上限完全匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个具有以下字段的表名称tblUsers

用户名(varchar,主键)
FullName(varchar)
地址(varchar)


当我使用vb.net搜索特定用户的数据时. SqlServer与UserName的大写字母"不完全匹配.

用户名"miang"和"MianG"给出相同的结果.我想在哪里SqlServer必须完全匹配包括caps的整个字符串.

请帮帮我


谢谢本文所指示的,您可以使用以下任何一种技术执行区分大小写的搜索:转换为二进制数据类型,使用COLLATE指定区分大小写,以及其他一些选项.为了获得更好的性能而不必更改表或创建视图,我将执行不区分大小写的搜索,然后使用COLLATE或二进制转换过滤那些结果以消除无效的结果.


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

解决方案

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.


这篇关于与上限完全匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆