sql server - Sending a variable as a parameter in second stored proc sql -


i wondering if possible in ssms. have stored proc that's within stored proc. possible pass variables of 1 stored proc parameter in second one. need variables stored 1 variable in second stored proc. example below.

create procedure storeproc1_sp @variable1 varchar(4000),  @variable2 varchar(4000) 

exec storedproc2 --how pass 2 above variables 1 paramater this

i know doesn't make sense way i'm asking apologize.

thank you,

i'm not sure why want combine them strings can concatenate them, perhaps seperator:

declare @variable3 varchar(max)  set @variable3 = @variable1 + '|' + @variable2  exec storedproc2 @variable3 

in storedproc2 split them based on '|'. this hacky.

why not change storedproc2 :

create procedure storeproc2_sp @variable1 varchar(4000), @variable2 varchar(4000) 

and pass exec storedproc2 @variable1, @variable2

?


Comments