Split column based on keyword in SSIS and delete from main colum

PANDEY Prashant 85 Reputation points
2023-08-09T14:54:40.2+00:00

Hello Experts,

In continuation of earlier raised question.

https://learn.microsoft.com/en-us/answers/questions/1320469/split-column-information-based-on-keywords-in-ssis

With the help of Token and TokenCount I am able to split information from ColumnA(having long sentence) and updating to ColumnB/ColumnC/ColumnD.

Kindly help to update Column A as well once the information is copied to ColumnB/C & D(means whatever sentences are copied to Column B/C/D should be deleted from Column A).

Thanks for understanding.

Prashant Pandey

Prashant Pandey.

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

Accepted answer
  1. Yitzhak Khabinsky 25,846 Reputation points
    2023-08-09T19:11:18.9266667+00:00

    Hi @PANDEY Prashant,

    Please try the following expression:

    LEFT(@[User::Tokens], FINDSTRING(@[User::Tokens] + "Assessment Criteria", "Assessment Criteria", 1) - 1)
    
    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Amira Bedhiafi 22,691 Reputation points
    2023-08-09T17:50:37.55+00:00

    Since you didn't provide enough information I am assuming the following :

    Create a new derived column (e.g., NewColumnA) that contains the updated value of ColumnA after removing the sentences copied to ColumnB/C/D.

    In the expression, you might need to manipulate the string using functions like REPLACE, SUBSTRING, etc., depending on the exact logic you need to remove the sentences.

    Then, replace ColumnA with the new derived column you've created.

    Or use a script task where you can write custom code to manipulate ColumnA. You may use C# to define exactly how you want to remove the sentences that were copied to ColumnB/C/D and update ColumnA with the modified value.

    0 comments No comments

Your answer

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