SQL Query Where Column = ” returning Emoji characters 🎃 and 🍰

This is collation dependant.

Matches empty string

SELECT 1 where N'' = N'🍰'  COLLATE latin1_general_ci_as

Doesn’t match empty string

SELECT 1 WHERE N'' = N'🍰'   COLLATE latin1_general_100_ci_as

The 100 collations are more up-to-date (though still not bleeding edge, they have been available since 2008) and you should use more modern collations unless you have some specific reason not to. The BOL entry for 100 collations specifically calls out

Weighting has been added to previously non-weighted characters that
would have compared equally.

Leave a Comment