SQL Server case sensitive

Source: Internet
Author: User
Table
Alter table name
Alter column name nvarchar (100) (type) Collate chinese_prc_ci_as
-- Case insensitive

ALTER TABLE TB
Alter column colname nvarchar (100) Collate chinese_prc_cs_as
-- Case sensitive

Modify to field
Also, in the design table-field-sorting rules -... Set case sensitivity

Database
Alter database
Collate chinese_prc_cs_as
-- Case sensitive

Alter database
Collate chinese_prc_ci_as
-- Case insensitive

Specify the sorting rule.
Windows sorting rule name
Specify the Windows sorting rule name in the Collate clause. The Windows sorting rule name consists of the sorting rule indicator and comparison style.
Syntax:
<Windows_collation_name >::=
Collationdesignator _ <comparisonstyle>
<Comparisonstyle >::=
Casesensitivity_accentsensiti.pdf
[_ Kanatypesensitive [_ widthsensitive]
| _ Bin

Parameters
Collationdesignator
Specifies the basic sorting rules used by Windows sorting rules. Basic sorting rules include:

Specifies the alphabet or language in which the sorting rules are applied when sorting by dictionary is specified.


Used to store non-UNICODE character data Code Page.
For example, latin1_general or French, both use the code page 1252 or Turkish, and use the code page 1254.

Casesensiti.pdf

The CI parameter is case insensitive and the CS parameter is case sensitive.

Accentsensiti.pdf

AI specifies no accent, and as specifies the accent.

Kanatypesensitive

Omitted specifies case-insensitive, and Ks specifies a Kana type.

Widthsensiti.pdf

Omitted specifies case-insensitive, and WS specifies case-sensitive.

Bin

Specify the binary sorting order.

Upper(TRANSACT-SQL)

Returns a character expression that converts lowercase data to uppercase.

Transact-SQL syntax conventions

Syntax

Upper (character_expression) parameter
Character_expression
A character data expression. Character_expression can be a constant, variable, character column, or binary data column.

The data type of character_expression must be implicitly converted to varchar. Otherwise, use cast to explicitly convert character_expression.

Return type
Varchar or nvarchar

Lower
Converts uppercase data to lowercase data and returns a character expression.

Syntax
Lower (character_expression)

Parameters
Character_expression

Is a character or binary data expression. Character_expression can be a constant, variable, or column. Character_expression must be a data type that can be implicitly converted to varchar. Otherwise, use cast to explicitly convert character_expression.

Return type
Varchar

Related Article

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.