0

I need to split the flow of data inside the data flow task of ssis based on a string comparison.

For example inside the split task i'm using this code "ISNULL(FINDSTRING("a,b,c,d",a,1))" which would return true(coz the findstring function returns 1 for this case) and it will always be true because even if i use "ISNULL(FINDSTRING("a,b,c,d",e,1))" the findstring function returns 0....

I need some function inside the split task where it compares two strings and returns true/false and based on the output i split the data flow...

Any suggestions are much appreciated. Thanks

Gowtham Ramamoorthy
  • 896
  • 4
  • 15
  • 36
  • 1
    Possible duplicate of [Is it possible to perform a "LIKE" statement in a SSIS Expression?](https://stackoverflow.com/questions/4739230/is-it-possible-to-perform-a-like-statement-in-a-ssis-expression) – Nick.Mc Nov 03 '17 at 04:35

1 Answers1

0

It sounds like you need to apply a conditional expression equivalent to an "IF THEN ELSE" that incorporates the string comparison.

Format:

boolean_expression ? expression1 : expression2

The ? is equivalent to a "then" and the ":" is equivalent to an "else". So, if boolean_expression is true, then expression1 (true result), else expression2 (false result). 1 == 1 ? "true": "false"

Applying your example in the conditional expression:

FINDSTRING("a,b,c,d", "a", 1) == 1 ? "true" : "false"

Sending the result of this to a variable, which can then be applied in the data flow split, should help. Let me know if you have any questions.

user3662215
  • 526
  • 4
  • 12