How can I stop package execution based on the output of a stored procedure?

I have an SSIS package in which the first task runs a stored procedure to ensure that the due date is not a holiday. If it is a holiday, it returns a set of records with a score of 1.

I want to stop SSIS if the write metric is 1, but continue to work if the write metric is zero. I do not know how best to implement this. Which control should I add to the package?

I'm relatively new to SSIS, so I don't know which item to add. Any help would be great.

+5
source share
2 answers

- Execute SQl , @Holiday. , Execute SQl, , , . Expression Constraint , , :

@Holiday == 0
+3

, . , , , . , . SSIS 2008 R2 SQL Server 2008 R2.

:

  • dbo.Holidays dbo.CheckTodayIsHoliday script, SQL Scripts. , # 1.

  • SSIS RecordCount SQLProcedure. , # 2. OLE DB SQL Server. SQLServer . . # 3. . .

  • SSIS Data Flow task OLE DB source Row count transformation. # 4.

  • OLE DB source, # 5 # 6. .

  • Row count transformation, # 7.

  • Control Flow , <

  • ( ), < 9.

  • Precedence Constraint Editor, # 10.

  • # 11 (June 16, 2011), dbo.Holidays, . , 16 2011 , , .

  • , # 12.

  • # 13 (June 16, 2011) , dbo.Holidays.

, .

SQL:

CREATE TABLE [dbo].[Holidays](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [HolidayDate] [datetime] NULL,
 CONSTRAINT [PK_Holidays] PRIMARY KEY CLUSTERED ([Id] ASC)
) ON [PRIMARY]
GO

CREATE PROCEDURE [dbo].[CheckTodayIsHoliday]
AS
BEGIN

    SET NOCOUNT ON

    SELECT  HolidayDate
    FROM    dbo.Holidays
    WHERE   DATEDIFF(DAY, HolidayDate, GETDATE()) = 0   
END
GO

β„–1:

1

β„–2:

2

β„–3: ​​

3

β„–4:

4

β„– 5:

5

β„– 6:

6

β„– 7:

7

# 8:

8

β„– 9:

9

β„– 10:

10

β„– 11:

eleven

β„– 12:

<411 >

β„– 13:

thirteen

+7

All Articles