select case when 'AB' = 'A?B' then 1 else 0 end
Result:1
Why is the question mark in the first string not visible?
Does anyone know a fix for this?
That first 'AB'
is really (A) (zero width space) (B).
For SqlServer a quoted string without an N prefix is treated as a single-byte-per-character string. Apparently the "non ascii" zero width space is translated into a question mark before comparing.
Adding the "N-prefix" gives the expected result (0):
select case when N'AB' = N'AB' then 1 else 0 end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With