This first 'AB' valid (A) (zero-width space) (B).
For SqlServer, a quoted string without the N prefix is treated as a string with one byte for a character. Apparently, the non-ascii space with zero width is converted to a question mark before comparison.
Adding an "N-prefix" gives the expected result (0):
select case when N'AB' = N'AB' then 1 else 0 end
Hans kesting
source share