select a.* from Pair_User a where 1=1 and UPPER(a.UserID) like 'EMH1001%' collate Chinese_PRC_CI_AS_WS and a.UserPassWord=123 _BIN 二进制排序 _CI(CS) 是否区分大小写,CI不区分, CS区分 _AI(AS) 是否区分重音,AI不区分, AS区分 _KI(KS) 是否区分假名类型,KI不区分, KS区分 _WI(WS)…
sql server默认不区分大小写查询,但是有的时候部分查询语句却需要区分大小写查询,这个时候就需要进行一些特殊处理.区分大小写主要分两种方法. 转二进制判断 select * from table where cast(name as varbinary)=cast('LiYuanBa' as varbinary) --短字符串 select * from table where cast(name as varbinary)=cast('LiYuanBaABCEDEF……' as varb…