|
Calculates MD5 hash of the given string accordingly to RFC1321
Syntax
xp_md5 variable1 [, variable2 , variable3 ...], @hash OUTPUT
Arguments
text
VARCHAR. Source text
hash
VARCHAR or VARBINARY. Variable that holds the hash value. It has
a constant
size of 32 chars.
Permissions
Execute permissions default to the public role.
Return Code Values
0 - success, or Error code
if failed. hash IS NOT NULL (success) or IS NULL (failure)
Example
declare @encrypted_password varchar(32)
-- Output result should not be less then
40 chars
declare @clear_password varchar(16)
select @clear_password='abc'
exec xp_md5 @clear_password,@encrypted_password OUTPUT
select @encrypted_password
|
The output should be :
----------------------------------------
900150983cd24fb0d6963f7d28e17f72
|