I just don't understand why this query is not pulling results

Well, this is the easiest request in the world, and it somehow fails.

SELECT * FROM kal_auth.dbo.Login WHERE ID = 'Zen' AND PWD = CONVERT(varchar,'0x9248FEFE237DB009')

0x9248FEFE237DB009is not hex, although it looks like this. but it converts to "Password"

I know that this line exists, and its only a password field that does not return results, it was studied by isolating and testing them.

The PWD field is varchar (16).

I do not understand this.

+3
source share
2 answers

Using

SELECT CONVERT(VARCHAR,0x9248FEFE237DB009) -- returns ’HΓΎΓΎ#}Β° 

Not

SELECT CONVERT(varchar,'0x9248FEFE237DB009') -- returns 0x9248FEFE237DB009

Having substituted it in quotation marks, it is processed as a string, and not as binary data, which means that converting to varchar does nothing!

+3
source

Maybe I missed something ...

CONVERT (varchar, '0x9248FEFE237DB009') "0x9248FEFE237DB009" 18 , ? , 16 char ?

+3

Source: https://habr.com/ru/post/1785392/


All Articles