Question : SQL Syntax Input/Output Parameters passing in initial values.

Is is possible to pass more than 1 input/output paramater to a stored procedure from within another stored procedure?

I want to pass in parameters into a stored proc lets say X = 5, Y= 10, Z = 4
I then want to manipulate them in the stored proc and return them so X = 6, Y = 9 , Z = 5

What is the syntax to do this?

Answer : SQL Syntax Input/Output Parameters passing in initial values.

You can pass as many parameters as you want, and use the same ones for input and output.
Just make sure to specify as OUTPUT in both the proc, and the call to it:

--sample proc
create proc testProc
      @x int output,
      @y int output,
      @z int output
as
begin

      set @x = 6
      set @y = 9
      set @z = 5

end




--sample call
declare @x int, @y int, @z int

set @x = 5
set @y = 10
set @z = 4

exec TestProc @x output, @y output, @z output

select @x, @y, @z  --these now have the new values since they were called as OUTPUT
Random Solutions  
 
programming4us programming4us