i have a stored procedure sp1 which takes parameters @id int, @type int, @ orderno int
Now, I am trying to call sp1 from sp2
alter proc sp2
/insert into @temp_tbl exec sp1 1,2,3
set @select = 'select * from @temp_tbl' --@select is already declared
exec (@select)
Now when I try to call my sp2
exec sp2
I get the error: procedure or function 'sp1' expects parameter @id, which was not supplied. so, how do I pass the parameters??
As simple as,for example:
but you obviously need the values to pass (which could come from other parameters, etc).
So, a more complete example: