-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Collation improvements: Part 1 of several #1727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…sql.md 1. Removed SQL Server version number from intro / summary. Behavior of this function does not vary between versions of SQL Server. 2. Improved wording of "LCID" definition: Defining LCID as LCID didn't give the reader any new information. 3. Improved wording of "Comparison" definition: A) Removed the word "case" (added by @fbsolo on 2018-04-23 via PR MicrosoftDocs#566 ) as it should not have been added. Properties cannot be case-sensitive. "Case" is a property that can be either sensitive or insensitive. B) added collation variations that have all sensitivities enabled. Unique variations for "everything-sensitive" collations found using the following query: SELECT DISTINCT SUBSTRING(col.[name], PATINDEX(N'%[_][BC][IS]%', col.[name]), 100) AS [Sensitivities] FROM sys.fn_helpcollations() col WHERE CONVERT(INT, COLLATIONPROPERTY(col.[name], N'ComparisonStyle')) = 0 ORDER BY [Sensitivities]; /* _BIN _BIN2 _CS_AS_KS_WS _CS_AS_KS_WS_SC _CS_AS_KS_WS_VSS */ 4. Improved wording of "Version" definition. The "derived from the collation ID version field" clause is awkward and has meaning to so few people that it really just confuses people. 5. Added "Base data type" to each property (based on format use in ( https://docs.microsoft.com/en-us/sql/t-sql/functions/serverproperty-transact-sql ). Data types discovered using the following query: SELECT SQL_VARIANT_PROPERTY(COLLATIONPROPERTY(N'Hebrew_100_CS_AS', N'CodePage'), 'basetype'), SQL_VARIANT_PROPERTY(COLLATIONPROPERTY(N'Hebrew_100_CS_AS', N'LCID'), 'basetype'), SQL_VARIANT_PROPERTY(COLLATIONPROPERTY(N'Hebrew_100_CS_AS', N'ComparisonStyle'), 'basetype'), SQL_VARIANT_PROPERTY(COLLATIONPROPERTY(N'Hebrew_100_CS_AS', N'Version'), 'basetype'); -- int int int tinyint
1. Added **_VariationSelectorSensitive ** property (introduced in SQL Server 2017) 2. Changed wording related to code pages to be "**varchar**" instead of "non-Unicode" since new UTF-8 collations in SQL Server 2019 use code page 65001 but are clearly not "non-Unicode" (this change will need to be made on several pages). 3. Better formatting in section describing the various sensitivities. 4. Updated wording and example code in **Remarks** section to make it clear that "undefined" in a particular collation does _not_ mean that the character does not exist. 5. Updated example Windows collations for correctness, consistency, and variety. 6. Minor improvements to query to find Windows collations TO DO: 1. Add info about _SC collations 2. Add info about _UTF8 collations 3. Add info about collation version numbers All of that is waiting until binary UTF-8 collation(s) are settled as the introduction of it (so far `UTF8_BIN2`) changes the syntax description quite a bit, and will require careful thought about new wording since neither version number, nor _SC, nor _UTF8 apply to "CollationDesignator" or "<ComparisonStyle>".
Contributor
|
@srutzky : Thanks for your contribution! The author, @CarlRabeler, has been notified to review your proposed change. |
Contributor
Author
|
Wow, thanks @CarlRabeler for the awesomely quick approval 😺 . P.S. No set ETA on the forthcoming parts / phases of the collation/Unicode updates, but they are coming. |
Contributor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first in a series of PRs to correct and/or complete various pages related to collations and/or Unicode support. Some of the pages, such as the one for Windows Collations, were missing updates starting with SQL Server 2012.
The two pages updated in this PR will be updated again, sometime soon, to include the new UTF-8 collations introduced in SQL Server 2019.
COLLATIONPROPERTY
Removed SQL Server version number from intro / summary. Behavior of this function does not vary between versions of SQL Server.
Improved wording of "LCID" definition: Defining LCID as LCID didn't give the reader any new information.
Improved wording of "Comparison" definition: A) Removed the word "case" (added by @fbsolo on 2018-04-23 via PR Update collation-functions-collationproperty-transact-sql.md #566 ) as it should not have been added. Properties cannot be case-sensitive. "Case" is a property that can be either sensitive or insensitive. B) added collation variations that have all sensitivities enabled. Unique variations for "everything-sensitive" collations found using the following query:
Improved wording of "Version" definition. The "derived from the collation ID version field" clause is awkward and has meaning to so few people that it really just confuses people.
Added "Base data type" to each property (based on format use in ( https://docs.microsoft.com/en-us/sql/t-sql/functions/serverproperty-transact-sql ). Data types discovered using the following query:
TO DO:
Windows Collations
Added _VariationSelectorSensitive property (introduced in SQL Server 2017)
Changed wording related to code pages to be "varchar" instead of "non-Unicode" since new UTF-8 collations in SQL Server 2019 use code page 65001 but are clearly not "non-Unicode" (this change will need to be made on several pages).
Better formatting in section describing the various sensitivities.
Updated wording and example code in Remarks section to make it clear that "undefined" in a particular collation does not mean that the character does not exist.
Updated example Windows collations for correctness, consistency, and variety.
Minor improvements to query to find Windows collations
TO DO:
All of that is waiting until binary UTF-8 collation(s) are settled as the introduction of it (so far
UTF8_BIN2) changes the syntax description quite a bit, and will require careful thought about new wording since neither version number, nor _SC, nor _UTF8 apply to "CollationDesignator" or "<ComparisonStyle>".