2013 m. vasario 16 d., šeštadienis

Collation types

SQL Serveris turi dviejų tipų collations: Windows collations and SQL Server collations.

BIN2 sorts and compares data in Microsoft SQL Server tables based on Unicode code points for Unicode data. For non-Unicode data, binary-code point uses comparisons that are identical to binary sorts. The advantage of using a binary-code point sort order is that no data re-sorting is required in applications that compare sorted SQL Server data. As a result, a binary-code point sort order provides simpler application development and possible performance benefits.

BIN_CS sorts and compares data in SQL Server tables based on the bit patterns defined for each character, however re-sorting is required on the application end.

CI_AS_KS and CI_AI do not provide automatic sorting on the application end.

http://msdn.microsoft.com/en-us/library/ms175194%28v=sql.105%29.aspx

http://msdn.microsoft.com/en-us/library/ms143515%28v=sql.105%29.aspx - Collation sorting styles

Pvz., jeigu buvo pakeista duomenų bazės collation, tada papildomai reikia perkurti visus ryšius ir indeksus, atitinkamai, jeigu keitėsi stulpelių collation.

Changing the collation at the column level requires some work, particularly if the tables have indexes and other constraints defined. If indexes and other constraints exist on the target column, those objects must be dropped before changing either the collation property or the data type.

Dropping indexes and constraints of pre-existing tables, changing column collation, and implementing required indexes and constraints again is the correct choice.

Dropping indexes and constraints of the preexisting tables where collation needs to be changed does not implement any change to the collation of data.

Auto-indexing is not an option.

Norint padaryti JOIN tarp dviejų lenetelių, reikia kad abu stulpeliai turėtų tą patį collation.

To make a join, the collation and data types of both columns should match.

The JOIN clause in

EUROPE  INNER JOIN US ON EUROPEREVENUE.ProductType = USREVENUE.USProductType COLLATE Greek_CI_AS

has the same column name, the same collation, and the same data types on both columns used for the join.

Komentarų nėra:

Rašyti komentarą