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

PowerShell: 1-Liner to Discover SQL Servers on the Network

Run this command on server with SQL CLI installed (this will only detect SQL servers…

How To Recover SQLSERVER Service from Being Unable to Start

# startSqlService.ps1 # special provision to deal with SQL Server not starting up due to…

mysqldump & gunzip

Create SQL Dump: # Higher compression if bzip2 is installed on the system # mysqldump…
Other project: DragonCoin.com