I'm sure this has been answered many times before on this forum - but I don't seem to be able to find it...
I have an sp(SP#1) built to insert records into a table (Table A).
This sp is used extensively by users and works great.
I am building another sp -- more of a back-office function. If certain conditions are met, I want to add a record into Table A. I would like to just piggyback on SP#1 rather than maintain twice the code.
How can I run SP#1 (and send parameters) from within SP#2. No records need be returned - just pass the parameters and update the table...
Is it as simple as:
Thanks.
Dave
I have an sp(SP#1) built to insert records into a table (Table A).
This sp is used extensively by users and works great.
I am building another sp -- more of a back-office function. If certain conditions are met, I want to add a record into Table A. I would like to just piggyback on SP#1 rather than maintain twice the code.
How can I run SP#1 (and send parameters) from within SP#2. No records need be returned - just pass the parameters and update the table...
Is it as simple as:
Code:
create procedure sp2
as
exec dbo.sp1 @param1=1,@param2=2
Thanks.
Dave