Ok so I have a table with three columns:
Id, Key, Value
I would like to delete all rows where Value is empty (''). Therefore I wrote the query to select before I delete which was:
Select * from [Imaging.ImageTag] where [Value] = ''
all pretty standard so far...
Now heres the strange part. This query returned two rows shown below with commas seperating columns:
CE7C367C-5C4A-4531-9C8C-8F2A26B1B980, ObjectType, 🎃
F5B2F8A8-C4A8-4799-8824-E5FFEEDAB887, Caption, 🍰
Why are these two rows matching on ''?
Extra Info
I am using Sql-Server, The [Value] column is of type NVARCHAR(300) and yes the table name really is [Imaging.ImageTag]
Value?Select *, CAST([value] as VARBINARY) from [Imaging.ImageTag] i where [Value] = ''(SQLServer notation..) and show us? I suspect that whatever bytes that make up the emoji are naively being treated as equal to an emtpy string by the compare, perhaps because they start with an ascii nul 0x00.. (perhaps the emoji is being converted to ascii to compare, and teh conversion is reducing it to '')SELECT 1 where '' = N'🍰'returns 1 - so it does match empty string for some reason.[Imaging.ImageTag]looks wrong. Do you really have a table with the name"Imaging.ImageTag"?