How to remove the value before the special character in SSIS

BeyondZ 60 Reputation points
2023-05-22T07:20:51.31+00:00

I have a column like:

001/balabala

002/balbaal

003/balabaal

And my expected output is:

balabala

balbaal

balabaal

That's say, I only want to keep the value after '/'

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
9,825 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,084 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 22,216 Reputation points
    2023-05-22T07:31:48.9533333+00:00

    Hi @BeyondZ,

    You may also use below code:

    RIGHT("yourcolumn",FINDSTRING(REVERSE("yourcolumn"),"/",1) - 1)

    Regards´╝î

    Zoe Hui


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

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 21,511 Reputation points
    2023-05-22T14:42:05.72+00:00

    Hi @BeyondZ,

    SSIS expression language has many useful functions. One of them is TOKEN().

    For the reference: https://learn.microsoft.com/en-us/sql/integration-services/expressions/token-ssis-expression?view=sql-server-ver16

    Here is an expression that you need for your scenario in the "Derived Column" Task:

    TOKEN([ColumnName], "/", 2)
    
    1 person found this answer helpful.
    0 comments No comments

  2. Olaf Helper 29,041 Reputation points
    2023-05-22T07:27:50.26+00:00

    Use a "Derived Column" task with the functions SUBSTRING and FINDSTRING, like

    SUBSTRING( [ColumnName] , FINDSTRING([ColumnName], "/", 1) + 1 , 100 )
    
    0 comments No comments