How to disable an execute package task Conditionally using SSIS.

  • I have a DTS package which disables Execute Package Task using Query which is written inside Dynamic Property Task and Query is:

    - DETERMINE LOAD TYPE (FULL/DELTAS)

    -- CONDITION: IF AN "F" RECORD EXISTS, DO NOT DISABLE

    IF EXISTS(SELECT TOP 1 * FROM dbo.sg_UAPApplications WHERE ActionCode = 'F')

    SELECT 0;

    ELSE

    SELECT 1;

    I want to convert the same package in SSIS . Please help me out, how to do the same.

  • You would do this type of logic in a precedence constraint in an SSIS package.

    Go to your Control Flow tab.

    Create another ExecuteSQL task and a variable. Execute your query to return 1 or 0 in the new task and return the results into a variable. Then, create a connector between the new ExecuteSQL task and the one that you want to run or skip. Then, right-click on the arrow and choose edit to configure the connector.

    I hope that explains it well enough. If it does not, post back here and I will try to state it more clearly and provide a picture or something.

  • Thanks, for your reply. But here I would like to know that how can I assign the result of an Execute SQL Task to a variable.

    It will be very helpful for me, If u tell about this.

  • Assuming you have a SQL statement that returns one column and one row like:

    SELECT GETDATE() AS MyDate

    1) Go to the control flow tab

    2) Create your variable

    3) Create an executeSQL task

    4) Edit the ExecuteSQL task

    - Choose a connection

    - Enter the SQL statement

    - Set the ResultSet property to Single Row

    - Click on the "Result Set" section

    - Click "Add" to add a result set

    - In the Variable Name column, choose your variable

    SSIS is pretty type-sensitive, so make sure your variable is of the correct type and length.

  • Thanks... I applied the same thing suggested by u and it is working.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply