I have a stored procedure that calls another stored procedure within it. And I've created a temp table that have the values I want to pass to the inner stored procedure. Is there a way to do this without having to create a bunch of variables?
An example:
CREATE PROCEDURE usr_AdminSaveChanges
-- Add the parameters for the stored procedure here
@blah varchar(5) = NULL,
@tid int = NULL
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- only returns one row
select testid, testfoo, testbar
into #testtemp
from testtable
where tid = @tid
exec usr_updateTestSP #testtemp.testid, @blah, #testtemp.testbar
END