MSSQL Case-sensitive details _ database other

Source: Internet
Author: User
Tags microsoft sql server mssql
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--case-insensitive
2. If you want all storage tables on the server to be case-sensitive, you need to set the server's collation when you install the server
or run
ALTER DATABASE Testgrass COLLATE Chinese_prc_cs_ai
3. If you modify the default collation for the entire server, rebuild the master library with Rebuildm.exe

SQL Server\80\tools\binn\rebuildm.exe
4. Or <a href=> diagram </a>
1. First open the Oblog database Oblog_user table, right click, select the Design table
2. Find the Username field
3. Then find the following sorting rules
4. Select case-sensitive in the dialog box that pops up

Reference:
We often encounter such statements when we create a table, such as:
Password nvarchar (ten) collate chinese_prc_ci_as NULL,
So what exactly does it mean? Take a look at the following:
First, COLLATE is a clause that can be applied to a database definition or a column definition to define a collation, or to a string expression to apply a sort rule projection. The syntax is:
Collate collation_name
Collation_name:: ={windows_collation_name}| {Sql_collation_name}
Parameter collate_name is the name of the collation that is applied to an expression, a column definition, or a database definition. Collation_name can be just a 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 description of the collation:
What is a sort rule? Ms describes this: "in Microsoft SQL Server 2000, the physical storage of strings is controlled by collations." Collations specify the bit patterns that represent each character and the rules used to store and compare characters. "
Execute the following statement within Query Analyzer to get all the collations supported by SQL Server.
SELECT * FROM:: Fn_helpcollations ()
The collation name is composed of two parts, and the first half refers to the character set supported by this collation. Such as:
Chinese_prc_cs_ai_ws
First half: Refers to the Unicode character set, the collation of the CHINESE_PRC_ pointer to the Chinese simplified characters Unicode.
The latter part of the collation is the suffix meaning:
_bin binary Sorting
_ci (CS) is case-sensitive, CI does not differentiate, CS differentiates
_ai (AS) is accent-sensitive, AI does not differentiate, as differentiates
Whether _ki (KS) differentiates kana types, KI does not differentiate, KS differentiates
Whether _wi (WS) differentiates width WI does not differentiate, WS differentiates
Case sensitive: Select this option if you want comparisons to treat uppercase and lowercase letters as unequal.
Accent Sensitivity: Select this option if you want comparisons to treat accent and unstressed letters as unequal. If you select this option, the comparison also treats letters with different accents as unequal.
Kana: Select this option if you want comparisons to treat katakana and hiragana Japanese syllables as unequal.
Width Sensitive: Select this option if you want the comparison to treat Half-width and full-width characters as unequal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.