Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL_Latin1_General_CP1_CS_AS vs Latin1_General_CS_AS

What are the exact differences between the SQL_Latin1_General_CP1_CS_AS and Latin1_General_CS_AS collations in SQL Server?

like image 671
Chintan Shah Avatar asked Mar 14 '12 08:03

Chintan Shah


People also ask

What is the difference between Latin1_General_CI_AS and 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.

Which collation is best in SQL Server?

However here are the settings we typically recommend: Set the default collation to SQL_Latin1_General_CP1_CI_AS. Ensure that you have SQL Server running in Case Insensitive mode. We use NCHAR, NVARCHAR string types so all data is unicode, so no character set is specified.

What is collate Latin1_General_CS_AS in SQL Server?

According the SQL Server Books Online, the characters included in range searches depend on the sorting rules of the collation. Collation Latin1_General_CS_AS uses dictionary order so both upper and lower case characters of the specified range are included.

Is SQL_Latin1_General_CP1_CI_AS deprecated?

The documentation recommends SQL_Latin1_General_CP1_CI_AS as the recommended code page, but that is now considered obsolete in newer versions of MS SQL Server.


1 Answers

I'd add this as a comment, but I don't have enough reputation.

Anyway, see this question for details on these collations and how they relate:

Can SQL Server SQL_Latin1_General_CP1_CI_AS be safely converted to Latin1_General_CI_AS?

To avoid hijacking that answer entirely, the only real difference is the sort order for some characters differs between the two collations. Character representation does not appear to differ.

The only thing I would add is that SQL_Latin1_General_CP1_CS_AS is the default collation for the English (United States) locale, and Latin1_General_CS_AS is the default collation for any other English locale, such as English (United Kingdom).

like image 98
Ian Preston Avatar answered Sep 19 '22 14:09

Ian Preston