Posted On July 1, 2020

Latin1_General_CI_AI vs SQL_Latin1_General_CP1_CI_AS

kimconnect 2 comments
blog.KimConnect.com >> Database >> Latin1_General_CI_AI vs SQL_Latin1_General_CP1_CI_AS

The SQL_Latin1_General_CP1_CI_AS collation is a SQL collation and the rules around sorting data for unicode and non-unicode data are different. The Latin1_General_CI_AS collation is a Windows collation and the rules around sorting unicode and non-unicode data are the same.

– The Windows collation can use an index while comparing unicode and non-unicode, such as nvarchar to varchar, with a slight performance cost. The SQL collation cannot use the index while comparing data in such scenarios.
– Some characters that are treated as independent letters. For example, operator LIKE '%ß%' will return that exact match in SQL collation, while Windows collation will also return LIKE '%ss%' as the expanded character of ß to ss.
– Mixing collations within the database can cause errors such as this: ‘Cannot resolve the collation conflict between “SQL_Latin1_General_CP1_CI_AS” and “Latin1_General_CI_AI” in the equal to operation.’
– Collation can be specified in a statement to instruct the SQL engine to use such collation ad-hoc (e.g. SELECT * FROM SomeTable WHERE SomeField COLLATE SQL_Latin1_General_CP1_CI_AS = N'ßeta')

2 thoughts on “Latin1_General_CI_AI vs SQL_Latin1_General_CP1_CI_AS”

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Microsoft Dynamics 365: System Administrator Profile Corruption Problem

Symptoms: Field Security Profile Does Not List Enabled Custom Fields Certain forms would show a…

PowerShell: Detect Microsoft SQL Version and Installed Location

function getSqlInfo{ $results=@() $instances=(get-itemproperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances foreach ($i in $instances){ $p=(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance…

Microsoft SQL Server Replication Setup Error Number MSSQL_REPL2110 and Resolution

Symptom: The distribution agent failed to create temporary files in 'C:\Program Files\Microsoft SQL Server\130\COM' directory…