Hi manorsheep,
写了一个最简单的,你参考一下:
create procedure A
as
begin
print 'hello A'
end
create procedure B
as
begin
print 'hello B'
end
create procedure if_else
(@a int)
as
begin
if (@a = 1)
begin
exec dbo.A
end
else
begin
exec dbo.B
end
end
exec dbo.if_else @a = 2
Best Regards,
Teige
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.