I want to compare varbinary
type with byte array. I have tried so far:
DECLARE @data AS NVARCHAR(MAX)='4283'
Select * from table1 Where bindayData=CAST(@data AS VARBINARY)
But this does not work.
I note one strange behavior of this: when I statically use it like
Select * from table1 Where bindayData=CAST('4283' AS VARBINARY)
then it works fine. But when I declare a variable, it doesn't work.
Please share your ideas.