24 October 2008

hash function in sql

Just stumbled across this cool sql 2005 feature:

SELECT HashBytes('MD5','password')

Why did no one tell me about this before? This could have saved me HOURS of short pointless cf script writing.

1 comment:

webdesigner said...

this translates it into a string:

SELECT UPPER (SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'password')), 3, 32))