I want to create a stored procedure to be used within a stored procedure something like shown below. Is this possible?
CREATE procedure parentSP
as
--child SP definition.
CREATE procedure childSP1 @inputArg varchar(50)
as
--do something.
Go
--call child sp within parentSP
execute childSP1 '10'
Go
You can use exec:
CREATE procedure parentSP
as
exec('CREATE procedure childSP1 @inputArg varchar(50)
as
--do something.')
--call child sp within parentSP
execute childSP1 '10'
Go
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With