I have a script that updates a user table and sets the passwords to a hash value using the Hashbytes function:
set [password] = HashBytes('MD5', 'PW4' + [UserName]),
HasChangedPassword = 0
This is producing unexpected results in that if I run the Hashbyte function for a specific user value, such as:
select HashBytes('MD5', 'PW4avenue')
I get a result of '0x8847665608F36E2534A655D3EB57BC0F', but the table updated from the above statement has '0x1E0F528E3CD45F3D9BEFBFFAB073FE41' in it.
I can't figure out where this value is coming from.
Running this query:
select HashBytes('MD5', 'PW4' + [UserName]) as [password],
'PW4' + [UserName] as test from secUser
where [UserName] = 'avenue'
returns these results:
avenue 0x1E0F528E3CD45F3D9BEFBFFAB073FE41 PW4avenue
Any ideas what is going on here?