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

SQL AlwayOn High Availability Default Port

Internal SQL DEV & QA environments may have SQL listening to the default port of…

PowerShell: Microsoft SQL Database Migration

Update 9/25/20: There's another version of this script has has been rewritten form scratch. IMO,…

MS SQL: Using Profiler to Trace Failed Logins

Story: There has been an issue with a service account triggering login errors at the…
Other project: DragonCoin.com