I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command:
SELECT HashBytes(\'MD5\', \'HelloWorld\')
convert(varchar(34), HASHBYTES('MD5','Hello World'),1)
(1 for converting hexadecimal to string)
convert this to lower and remove 0x from the start of the string by substring:
substring(lower(convert(varchar(34), HASHBYTES('MD5','Hello World'),1)),3,32)
exactly the same as what we get in C# after converting bytes to string