create procedure [dbo].[up_update_agentaccount_md5] as set nocount on begin UPDATE AgentAccount SET Password = SUBSTRING(master.dbo.fn_varbintohexstr( HashBytes('MD5', Password)), 3, 32) end