select SUBSTRING(sys.fn_sqlvarbasetostr(HASHBYTES(‘MD5‘,‘123456‘)),3,32)
sql加密之MD5加密
原文:http://www.cnblogs.com/hllive/p/6062334.html