How to choose collation of SQL Server database

喜夏-厌秋 提交于 2020-01-03 07:31:12

问题


What if I want to use database to store different groups of special characters, how do I choose which collation to use? For example, if I set collation to Croatian and want to use Russian cyrillic, japanese characters except croatian special characters - which collation should I use?

Thanks, Ilija


回答1:


  • You'd use nvarchar to store the data
  • COLLATION defines sorting and comparing

That means you can store Croatian, Russian and Japanese in the same column.

But when you want to compare (WHERE MyColumn = @foo) or sort (ORDER BY MyColumn) you'll not get what you expect because of the collation.

However, you can use the COLLATE clause to change it if needed. eg ORDER BY MyColumn COLLATE Japanese_something

I'd go for your most common option that covers most of your data. MSDN has this maybe useful article



来源:https://stackoverflow.com/questions/4552882/how-to-choose-collation-of-sql-server-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!