【发布时间】:2022-12-02 06:33:57
【问题描述】:
When executing that query:
SELECT HashBytes('MD5', CONCAT('AVS',convert(nvarchar,313),'@310001')) as mycol ...
I get HashBytes represented such as
0xA6A0D....
When I do not convert, the HashBytes look like the following:
SELECT HashBytes('MD5', CONCAT('AVS','313','@310001')) as mycol
0x88230...
Why is it different?
【问题讨论】:
-
N'313'and'313'aren't the same value, and therefore, neither areN'AVS313@310001'and'AVS313@310001'and so you get different hash values. Data typing is important.
标签: sql-server