declare @pa varchar(max)
declare @pa2 varchar(max)
set @pa= (select upper(SUBSTRING(sys.fn_sqlvarbasetostr(HASHBYTES('MD5','s_'+'123')),3,32)))
set @pa2=( select upper(SUBSTRING(sys.fn_sqlvarbasetostr(HASHBYTES('MD5', @pa )),3,32)))
SELECT @pa2
select upper(SUBSTRING(sys.fn_sqlvarbasetostr(HASHBYTES('MD5', (select upper(SUBSTRING(sys.fn_sqlvarbasetostr(HASHBYTES('MD5','s_'+'123')),3,32))) )),3,32))
返回不同结果的问题在于参数类型一定要是varchar(100)