What is the purpose of using COLLATE in a query?



What is the purpose of using COLLATE in a query?..

Answer / guest

The term, collation, refers to a set of rules that determine
how data is sorted and compared. In Microsoft? SQL Server
2000, it is not required to separately specify code page and
sort order for character data, and the collation used for
Unicode data. Instead, specify the collation name and
sorting rules to use. Character data is sorted using rules
that define the correct character sequence, with options for
specifying case-sensitivity, accent marks, kana character
types, and character width. Microsoft SQL Server 2000
collations include these groupings:
? Windows collations - Windows collations define rules for
storing character data based on the rules defined for an
associated Windows locale. The base Windows collation rules
specify which alphabet or language is used when dictionary
sorting is applied, as well as the code page used to store
non-Unicode character data. For Windows collations, the
nchar, nvarchar, and ntext data types have the same sorting
behavior as char, varchar, and text data types
? SQL collations - SQL collations are provided for
compatibility with sort orders in earlier versions of
Microsoft SQL Server.
Sort Order
Binary is the fastest sorting order, and is case-sensitive.
If Binary is selected, the Case-sensitive, Accent-sensitive,
Kana-sensitive, and Width-sensitive options are not available.

Sort order Description
Binary Sorts and compares data in Microsoft? SQL Server?
tables based on the bit patterns defined for each character.
Binary sort order is case-sensitive, that is lowercase
precedes uppercase, and accent-sensitive. This is the
fastest sorting order.
If this option is not selected, SQL Server follows sorting
and comparison rules as defined in dictionaries for the
associated language or alphabet.
Case-sensitive Specifies that SQL Server distinguish between
uppercase and lowercase letters.
If not selected, SQL Server considers the uppercase and
lowercase versions of letters to be equal. SQL Server does
not define whether lowercase letters sort lower or higher in
relation to uppercase letters when Case-sensitive is not
selected.
Accent-sensitive Specifies that SQL Server distinguish
between accented and unaccented characters. For example, 'a'
is not equal to '?'.
If not selected, SQL Server considers the accented and
unaccented versions of letters to be equal.
Kana-sensitive Specifies that SQL Server distinguish between
the two types of Japanese kana characters: Hiragana and
Katakana.
If not selected, SQL Server considers Hiragana and Katakana
characters to be equal.
Width-sensitive Specifies that SQL Server distinguish
between a single-byte character (half-width) and the same
character when represented as a double-byte character
(full-width).
If not selected, SQL Server considers the single-byte and
double-byte representation of the same character to be equal.
Windows collation options:
? Use Latin1_General for the U.S. English character set
(code page 1252).
? Use Modern_Spanish for all variations of Spanish, which
also use the same character set as U.S. English (code page
1252).
? Use Arabic for all variations of Arabic, which use the
Arabic character set (code page 1256).
? Use Japanese_Unicode for the Unicode version of Japanese
(code page 932), which has a different sort order from
Japanese, but the same code page (932).

Is This Answer Correct ?    9 Yes 3 No

Post New Answer

More SQL Server Interview Questions

What is use of @@ spid in sql server?

0 Answers  


what is the use of database index(apart from the last searching of records) and what is the use of composite key?

1 Answers  


Questions regarding Raiseerror?

1 Answers  


your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files? : Sql server administration

0 Answers  


Is sql server is free?

0 Answers  






How to display n-1 columns from n number of columns, from a single table in MS SQL server 2005?

2 Answers  


Differencr Between DELETE and TRUNCATE?

3 Answers   ADP,


Explain filestream storage of sql server 2008?

0 Answers  


What is the difference between UNION and UNIONALL?

5 Answers   CarrizalSoft Technologies, CTS,


How can you start sql server in different modes?

0 Answers  


What is sub query and its properties?

0 Answers  


Why and when do stored procedure recompile?

0 Answers  


Categories