0

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

enter image description here

Hossein Narimani Rad
  • 31,361
  • 18
  • 86
  • 116
  • That's a broad topic. Which part of it are you having trouble with? – Tab Alleman Apr 13 '15 at 13:54
  • @TabAlleman I dont know how to pass those words which are readed through the FlatFileSource to the script component – Hossein Narimani Rad Apr 14 '15 at 12:26
  • 1
    Store the words in a variable, either an object (recordset) or a delimited string. There are a number of ways to do this, whichever you prefer: https://www.google.com/search?sourceid=navclient&aq=&oq=SSIS+read+flat+file+into+&ie=UTF-8&rlz=1T4GGNI_enUS551US551&q=ssis+read+flat+file+into+variable&gs_l=hp..0.0j0i22i30l4.0.0.0.7223...........0.C5CuxngGoHQ – Tab Alleman Apr 14 '15 at 13:01
  • @TabAlleman post your idea as an answer so I can mark it as answer if it works and it would be helpful for others encountering similar problems – Hossein Narimani Rad Apr 16 '15 at 05:46

1 Answers1

0

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.

Tab Alleman
  • 31,483
  • 7
  • 36
  • 52