Findstring issue SSIS

SLi 105 Reputation points
2024-01-29T08:20:30.7+00:00

I have a string like (first)0001ABC_Leo, i want to extra the value with 0001ABC. I tried with findstring but it doesn't work. Please help!Thank u in advance.

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

Accepted answer
  1. ZoeHui-MSFT 34,186 Reputation points
    2024-01-29T08:54:45.2933333+00:00

    Hi @SLi

    If you only want to extra the one value, you may easily use substring to do that.

    SUBSTRING("(first)0001ABC_Leo",8,7)

    If not, please provide more details about your column value or regular of your column.

    Regards,

    Zoe Hui


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


1 additional answer

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,286 Reputation points
    2024-01-31T15:05:04.1233333+00:00

    Hi @SLi, It is much better to use tokenization for such scenarios.

    • (first)0001ABC_Leo => 0001ABC
    • (second)0002ABC_Yoga => 0002ABC

    Check it out the following SSIS expression leveraging TOKEN() function:

    TOKEN(REPLACE(@[User::inputString],")","_"), "_", 2)

    1 person found this answer helpful.
    0 comments No comments