简体   繁体   中英

How to remove words in a flat file from a column string of words using SSIS

I have a simple flat file like this:

Forbidden Words

Word1

Word6

Word3

Then I'm going to remove these words from a column values in a table like this(words are separated using ';'):

Original Column Values

word1;word5;word8;word2;word6

word2;word4;word1;word0;word9

// and so on

I used an OLE DB Source to read the table from SQL and do some conversion and used a script component to remove these words. I can use a Flat file source to read the forbidden words but how to use them in the script component so make a result like this:

Transformed Column Values

;word5;word8;word2;

word2;word4;;word0;word9

// and so on

在此处输入图片说明

You can store the words from the flat file in a variable. It can either be an Object-type variable that holds a recordset, or a delimited string variable.

Either way, you can then pass the variable to your Script Component and use it in the script to remove the forbidden words from your dataflow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM