Search code examples
sqlssissql-likecase-statementdataflowtask

Is it possible to perform a "LIKE" statement in a SSIS Expression?


I'm using a Derived Column Task to change column data using a CASE WHEN statement. However, I need to be able to say..

SQL CODE WOULD BE:

CASE WHEN Column01 LIKE '%i%' THEN '0' ELSE '1' END


In SSIS Expression Language that would be:

[Column01] == "i" ? "0" : "1"  (that's for equals i, not, LIKE %i%.


Is it possible to use a LIKE operator?


Solution

  • I believe you'll want to use the FINDSTRING function.

    FINDSTRING(character_expression, searchstring, occurrence)

    ...

    FINDSTRING returns null if either character_expression or searchstring are null.