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.

链接地址: http://www.djcxy.com/p/51392.html

上一篇: 分割一个字符串,c#

下一篇: 如何使用SSIS从列字符串中删除平面文件中的单词