Achieving consistent sorting between c# and SQL using CollationInfo.Comparer

前端 未结 1 510
清歌不尽
清歌不尽 2021-01-20 02:14

I am attempting to use CollationInfo.Comparer from SMO to get my c# code to sort like SQL Server. I have gotten the correct collation, but my items still do not sort correc

相关标签:
1条回答
  • 2021-01-20 02:41

    The legacy "SQL" collation sorting is not aligned with Windows "word-sort" algorithm. You'll need to use a Windows collation (e.g. Latin1_General_CS_AS) for the columns in the database to get the same behavior.

    0 讨论(0)
提交回复
热议问题