Why some emojis in SQL Server are equal?

2019-08-09 11:00发布

问题:

I using SQL Server 2016 and have one database with Arabic_100_CI_AS and I inserted apple emojis to my database but some of emojis are equals in condtions but other emojis are not equal

select 1
where N'⛑' = N'✅'

or

select 1
where N'✊' = N'⭐️'

This emojis are equals:

✊ ✋ ⛑ ⭐️ ✨ ⛅️ ⛈ ⛄️ ⚽️ ⚾️ ⛳️ ⛸ ⛷ ⛹️ ⛵️ ⛴ ⛽️ ⛲️ ⛱ ⛰ ⛺ ⛪️ ⛩ ⏱ ⏲ ⏰ ⏳ ⛏ ⛓ ⛎ ❌ ⭕️ ⛔️ ❗️ ❕ ❓ ❔ ✅ ❎ ⏸ ⏯ ⏹ ⏺ ⏭ ⏮ ⏩ ⏪ ⏫ ⏬ ➕ ➖ ➗ ➰ ➿ ⬛️ ⬜️

回答1:

As Mr. Martin Smith suggest try to collate them with help of Arabic, binary sort

select 1
where N'⛑' = N'✅' collate Arabic_BIN

or

select 1
where N'✊' = N'⭐️' collate Arabic_BIN

To answer your question : The equality of your emojis are dependent on collation.