I have a master stored procedure in which have many sub stored procedures, say 10 stored procedures.
What I want is if I specify that stored procedure 1, stored procedure 2, then only these 2 stored procedures should be executed, the other 8 should not be executed.
And if I don't specify any value for the ordering, then it should execute all the stored procedures.
Someone please tell me how to do it? Is there any way to implement it?
I need 1 parameter which could be comma separated. That is if we specify 1,2 in a parameter then it will execute stored procedures 1 and 2.
SET QUOTED_IDENTIFIER ON;
GO
SET ANSI_NULLS ON;
GO
SET NOCOUNT ON;
GO
CREATE PROCEDURE dbo.CI_ILR_Indicator_Master
(
@StartYear INT,
@EndYear INT
)
AS
BEGIN
--Temptable '#TempILR' is created, which contains the common data needed for all the indicator calculation of 'ILR'
--Executing the SP [dbo.CI_ILR_Indicator_VRQ_WBL Indicators] for the ILR Indicator group
--'ILR VRQ WBL' for Indicators (8,9,10)
EXEC SP1 @StartYear,@EndYear
EXEC SP2 @StartYear,@EndYear
EXEC SP3 @StartYear,@EndYear
EXEC SP4 @StartYear,@EndYear
EXEC SP5 @StartYear,@EndYear
EXEC SP6 @StartYear,@EndYear
EXEC SP7 @StartYear,@EndYear
EXEC SP8 @StartYear,@EndYear
EXEC SP9 @StartYear,@EndYear
EXEC SP10 @StartYear,@EndYear
END
This is how my SP looks..