我想创建一个存储过程,以便在存储过程中使用,如下所示。这可能吗?
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
答案 0 :(得分:10)
您可以使用exec:
CREATE procedure parentSP
as
exec('CREATE procedure childSP1 @inputArg varchar(50)
as
--do something.')
--call child sp within parentSP
execute childSP1 '10'
Go