Handling null values with Conditional Split in SSIS

Geraldo Peralta 86 Reputation points
2023-03-08T10:32:24.3966667+00:00

Hello, community.

I am using Conditional Split in SSIS. I need to handle null values. If a null value appears, I just want to ignore it and the flow to continue.

I have some conditions:

  1. MyColumn == "String"
  2. ISNULL(MyColumn) --> The expression on "Conditional Split.Outputs evaluated to NULL, but the "Conditional Split" requires a Boolean results. 
  3. Everything else (Conditional Split Default Output).

Thanks in advanced.

Regards,

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 41,491 Reputation points
    2023-03-09T03:18:57.62+00:00

    Hi @Geraldo Peralta,

    Try with below:

    1. REPLACENULL([MyColumn],0) == "String"
    2. ISNULL(MyColumn) -->
    3. Everything else (Conditional Split Default Output).

    And then connect case1 and default output to next steps.

    User's image

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Amira Bedhiafi 33,071 Reputation points Volunteer Moderator
    2023-03-08T14:42:26.7766667+00:00

    Try to use the ISNULL function along with the logical OR operator (||) to create a condition that checks for both null values and the desired condition you want to have.

    • You can create a condition with the expression MyColumn == "String"
    • Then create a second condition with the expression ISNULL(MyColumn) || MyColumn == "" : The ISNULL function checks if MyColumn is null. If it is, the expression evaluates to true and the flow continues. If MyColumn is not null, the expression moves to the logical OR operator, which checks if MyColumn is an empty string (""). If it is, the expression evaluates to true and the flow continues. If MyColumn is neither null nor an empty string, the expression evaluates to false and the flow goes to the default output.
    • Else (Conditional Split Default Output): The default output should be connected to the next step in the data flow.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.