sql server - Can't return varbinary datatype from Stored Procedure -


i call stored procedure this:

exec @varbinary = [procedure] @param1='test',@param2='test',@outputparam = @output output 

which goes procedure:

alter procedure [procedure]     @param1 varchar(50), @param2 varchar(32), @output varbinary(128) output begin set nocount on;      set @param1 += @param2      set @output = convert(varbinary(128),hashbytes('sha2_512',@param1),2)      --select @output     return  end      go 

it returns 0x00000000. if select value directly procedure, works intended.

everything fine code -

alter procedure usp_proc (     @param1 varchar(50),     @param2 varchar(32),     @outputparam varbinary(128) output ) begin      set nocount on;      set @outputparam = convert(varbinary(128), hashbytes('sha2_512', @param1+@param2),2)      select @outputparam  end     go  declare @output varbinary(128) exec usp_proc @param1='test', @param2='test', @outputparam = @output output select @output 

output -

---------------------------------------------- 0x125d6d03b32c84d492747f79cf0bf6e179d287f34138  ---------------------------------------------- 0x125d6d03b32c84d492747f79cf0bf6e179d287f34138 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -