1.--Case sensitive
select * from a where a='AbCdE' collate Chinese_PRC_CS_AI--case sensitive
select * from a where a='abCdE' collate Chinese_PRC_CI_AI--insensitive
2. If you want all storage tables on the server to be case sensitive, you need to set the server's sorting rules when installing the server.
Or run
alter database testgrass collate Chinese_PRC_CS_AI
3. If you modify the default sorting rules of the entire server, use rebuild the master library.
SQL Server\80\Tools\Binn\
4. Or <a href=>illustration</a>
1. First open the oblog_user table of the oblog database, right-click, and select the design table
2. Find the username field
3. Then find the following sorting rules
4. Select case-sensitive in the pop-up dialog box
refer to:
We often encounter such statements when creating table, such as:
password nvarchar(10)collate chinese_prc_ci_as null,
Then what does it mean? Let's take a look at the following:
First, collate is a clause that can be applied to a database definition or column definition to define a collation, or to a string expression to apply a collation projection. The syntax is:
collate collation_name
collation_name ::={windows_collation_name}|{sql_collation_name}
The parameter collate_name is the name of the collation applied to the expression, column definition, or database definition. collation_name can be just the specified Windows_collation_name or SQL_collation_name.
Windows_collation_name is the collation name of the Windows collation. See Windows collation name.
SQL_collation_name is the collation name of the SQL collation. See SQL collation name.
The following is a brief introduction to the sorting rules:
What is sorting rules? MS describes it as follows: "In Microsoft SQL Server 2000, the physical storage of strings is controlled by sorting rules. The sorting rules specify the bit pattern representing each character and the rules used to store and compare characters."
Execute the following statement in the query analyzer to obtain all sorting rules supported by SQL SERVER.
select * from ::fn_helpcollations()
The collation rule name consists of two parts, the first half refers to the character set supported by this collation rule. like:
Chinese_PRC_CS_AI_WS
The first half: refers to the UNICODE character set, and Chinese_PRC_ refers to the sorting rules for the simplified Chinese character UNICODE in mainland China.
The second half of the sorting rule is the suffix. Meaning:
_BIN Binary sort
_CI(CS) is case sensitive, CI is not distinguished, CS is distinguished
_AI(AS) Whether to distinguish between stress, AI does not distinguish between stress, AS
_KI(KS) Whether to distinguish between pseudonyms, KI does not distinguish between, KS distinguish between
_WI(WS) Whether to distinguish width? WI does not distinguish, WS distinguish
Case sensitivity: If you want the comparison to treat uppercase and lowercase letters as different, select this option.
Distinguishing stress: Select this option if you want the comparison to consider stress and non-stressed letters as inequality. If you select this option, the comparison also treats letters with different accents as varying.
Distinguishing Kana: If you want the comparison to treat Katakana and Hiragana Japanese syllables as different, please select this option.
Distinguish width: If you want the comparison to treat half-width and full-width characters as different, select this option.
select * from a where a='AbCdE' collate Chinese_PRC_CS_AI--case sensitive
select * from a where a='abCdE' collate Chinese_PRC_CI_AI--insensitive
2. If you want all storage tables on the server to be case sensitive, you need to set the server's sorting rules when installing the server.
Or run
alter database testgrass collate Chinese_PRC_CS_AI
3. If you modify the default sorting rules of the entire server, use rebuild the master library.
SQL Server\80\Tools\Binn\
4. Or <a href=>illustration</a>
1. First open the oblog_user table of the oblog database, right-click, and select the design table
2. Find the username field
3. Then find the following sorting rules
4. Select case-sensitive in the pop-up dialog box
refer to:
We often encounter such statements when creating table, such as:
password nvarchar(10)collate chinese_prc_ci_as null,
Then what does it mean? Let's take a look at the following:
First, collate is a clause that can be applied to a database definition or column definition to define a collation, or to a string expression to apply a collation projection. The syntax is:
collate collation_name
collation_name ::={windows_collation_name}|{sql_collation_name}
The parameter collate_name is the name of the collation applied to the expression, column definition, or database definition. collation_name can be just the specified Windows_collation_name or SQL_collation_name.
Windows_collation_name is the collation name of the Windows collation. See Windows collation name.
SQL_collation_name is the collation name of the SQL collation. See SQL collation name.
The following is a brief introduction to the sorting rules:
What is sorting rules? MS describes it as follows: "In Microsoft SQL Server 2000, the physical storage of strings is controlled by sorting rules. The sorting rules specify the bit pattern representing each character and the rules used to store and compare characters."
Execute the following statement in the query analyzer to obtain all sorting rules supported by SQL SERVER.
select * from ::fn_helpcollations()
The collation rule name consists of two parts, the first half refers to the character set supported by this collation rule. like:
Chinese_PRC_CS_AI_WS
The first half: refers to the UNICODE character set, and Chinese_PRC_ refers to the sorting rules for the simplified Chinese character UNICODE in mainland China.
The second half of the sorting rule is the suffix. Meaning:
_BIN Binary sort
_CI(CS) is case sensitive, CI is not distinguished, CS is distinguished
_AI(AS) Whether to distinguish between stress, AI does not distinguish between stress, AS
_KI(KS) Whether to distinguish between pseudonyms, KI does not distinguish between, KS distinguish between
_WI(WS) Whether to distinguish width? WI does not distinguish, WS distinguish
Case sensitivity: If you want the comparison to treat uppercase and lowercase letters as different, select this option.
Distinguishing stress: Select this option if you want the comparison to consider stress and non-stressed letters as inequality. If you select this option, the comparison also treats letters with different accents as varying.
Distinguishing Kana: If you want the comparison to treat Katakana and Hiragana Japanese syllables as different, please select this option.
Distinguish width: If you want the comparison to treat half-width and full-width characters as different, select this option.