Share via

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

Answer accepted by question author

ZoeHui-MSFT 41,551 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.

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Yitzhak Khabinsky 27,196 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)

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

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