开发者

What's SQL Server's analogue of MySQL's unicode_ci collation?

As far as I understand, in MySQL unicode_ci (utf8_unicode_ci in particular) collations are meant to support all the characters regardless to locale.

I need to achieve the same with SQL Server 2008 R2. My database is going to contain data in very different languages (not limited to latin-based alphabets). I am not going to use 开发者_JAVA技巧non-Unicode strings at all. What collation should I chose?


You might as well go with Latin1_General_CI_AI

The reason is that unicode data is stored using NVarchar fields, SQL Server is more flexible in that it can mix Varchar (1-byte) and NVarchar (2-byte) data. So to match UTF8, any collation would do. As for CI - every single collation in 2008 allows for the CI specification to be added (it is a checkbox in the UI "case sensitive" - unchecked for insensitive).

The last bit and some others like width are just additional tuning on SQL Server.

Point #2 from http://forums.mysql.com/read.php?103,187048,188748

utf8_unicode_ci is fine for all these languages: Russian, Bulgarian, Belarusian, Macedonian, Serbian, and Ukrainian.

If you require sorting for a particular language, where languages handle accents differently, you need a specific dictionary order - refer here http://msdn.microsoft.com/en-us/library/ms144250.aspx. Otherwise Latin1_General is based on Latin-US

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜