Can SQL Server SQL_Latin1_General_CP1_CI_AS be safely converted to Latin1_General_CI_AS?

后端 未结 5 430
名媛妹妹
名媛妹妹 2020-12-09 08:32

We have a legacy database with some (older) columns using \"SQL_Latin1_General_CP1_CI_AS\" and more recent changes have used \"Latin1_General_CI_AS\".

This is a pain

5条回答
  •  囚心锁ツ
    2020-12-09 09:02

    Here is a more complete answer:

    https://www.olcot.co.uk/revised-difference-between-collation-sql_latin1_general_cp1_ci_as-and-latin1_general_ci_as/

    The key difference between these collations is in how they apply character expansion rules. Certain Latin characters may be expanded into multiple characters. The SQL_xxxx collations may ignore these character expansions when working with non-unicode text, but apply them for unicode text. As a result: joins, sorts, and comparisons may return different results when using one collation versus the other.

    Example:

    Under Latin1_General_CI_AS these two statements return the same set of records, as ß is expanded to ss.

    SELECT * FROM MyTable3 WHERE Comments = 'strasse'
    SELECT * FROM MyTable3 WHERE Comments = 'straße'
    

    When using SQL_Latin1_General_CP1_CI_AS the above statements return different records, since the ß is treated as a different character than ss.

提交回复
热议问题