Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql server thinks empty string equals to some characters

if N'ab' = N'aޢb' select 'hit'

this will print 'hit'. i dont know why did sql server thinks these two string are equal. it seems that '�', or 'ޢ' or just empty string, are equal for sql server.

like image 449
Kevin Yang Avatar asked Dec 07 '25 02:12

Kevin Yang


1 Answers

The character you are using is TAI LE LETTER SA which is part of a block in Unicode reserved for annotations. They are decorations and not really text, so they can be treated as invisible by SQL Server.

like image 197
RichardTheKiwi Avatar answered Dec 08 '25 20:12

RichardTheKiwi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!