This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15190|Reply: 0

[Source] SQL Server fields are case-sensitive

[Copy link]
Posted on 5/9/2019 2:15:46 PM | | | |
We use case-sensitive and query the aa string for a field, and we will not return AA or Aa records.

Method 1:

Select the table you want to modify, right-click - > design-> select the column you want to modify - > column properties view below - > calculate column specification - > collation rule - > check case-sensitive-> save.



Method 2:

Change the collation method through a SQL statement as follows:

As forSQL_Latin1_General_CP1_CS_ASandChinese_PRC_CS_ASI don't know, maybe it doesn't support Chinese! My field doesn't appear Chinese characters, so I'm using SQL_Latin1_General_CP1_CS_AS collation here.

The first half: refers to the UNICODE character set, and Chinese_PRC_refers to the sorting rules for the mainland simplified character UNICODE

The second half of the collation is the meaning of the suffix:

_BIN Binary sorting

_CI(CS) Whether it is case-sensitive, CI is not sensitive, and CS is sensitive

_AI (AS) Whether to distinguish between accents, AI does not distinguish, AS distinguishes

_KI(KS) Whether to distinguish between pseudonym types, KI does not, KS distinguishes

_WI(WS) whether to distinguish width WI does not distinguish, WS distinguishes


Name is case-sensitive, and the Like field is not case-sensitive, the effect is as follows:



Export the entire SQL script as follows:







Previous:2019 latest soft exam information security engineer video
Next:The 2019 second construction is a topic collected by the forum. Continuously updated
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com