You can create a stored with your query like below :
ALTER PROCEDURE [dbo].[proc_testExistence] (
@Result varchar(10) OUTPUT ) AS
BEGIN
IF EXISTS (IF EXISTS (SELECT * FROM TABLE WHERE IN ('1','2','3','4','5','6','7','8','9'))
SELECT @Result = 'Success';
ELSE
SELECT @Result = 'Failure';
END
Then create a variable named vResult
in your SSIS package :
Then in your SQL Task, in the SQL Statement :
EXEC proc_testExistence ? OUTPUT
Create this mapping :
Modify the Precedence Constraint for the first condition Success :
And for the second condition Failure :
Your flow is something similar to this :
You can add a breakpoint as above to check the value of your variable during debugging.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…