2016-10-10 5 views
0

従業員テーブルにアクティブ従業員と終了従業員の両方があり、私の列の1つが仕事用メールです。終了した従業員は、自分のEメールをリストアップし、アクティブな従業員は自分のEメールをリストする必要があります。しかし、私が情報を引き出しているソースシステムは、アクティブな従業員が自分の仕事の電子メールを更新できるようにします。だから私は個人的な電子メールをリストアップした活発な従業員がいくつかいます。SSIS - 許可しない場合

私の目的のために、私はすべてのアクティブな従業員に自分の仕事の電子メールをリストさせる必要があります。 SSISでは、私の問題を解決する最良の方法は何でしょうか?ここで

Ex: 
Name  Status Email 
Bob  Act  [email protected] 
Joey  Ter  [email protected] 
Randy  Act  [email protected] 

ランディのようにアクティブであることから、従業員は、ソースシステムで、私はランディからのデータは、彼の個人的なことを自分の電子メールを変更引っ張られ、@ workdomain.comで終わるメールを持っていますが、必要があります。ランディの電子メールは次のようにする必要があります。[email protected]

+0

現在のデータと期待される結果でサンプルデータを共有してください。 – p2k

+0

@ Pinwar13 edit – Joey

+1

を参照してください。なぜあなたの抽出スクリプトでこれを処理していませんか? – iamdave

答えて

0

私は以下のようにしました(OLEDB変換を避けるために、行ごとの操作)。

2つのステージングテーブル(テンポラリ・テーブルであってもよい)にデータをロード:

テーブル#1。 StageEmp:

Name  Status Email 
Bob  Act  [email protected] 
Joey  Ter  [email protected] 
Randy  Act  [email protected] 

表#2:

Update s 
SET s.email = c.email 
FROM StageEmp s 
Join CorrectEmail c 
ON s.Name = c.Name 
where s.status = 'Act' 
AND s.email not like '%@workdomain.com' 

あなたはNameの代わりにkey列を使用する必要があります。でCorrectEmail

Name  Email 
Randy  [email protected] 

は、SQLタスクを実行します。

StageEmpのデータを実際のテーブルにロードするか、実際のテーブルに直接更新します。

0

私によれば、1つのExcelソースからExcelからデータを取り出すための1つのデータフロータスクがあります。このようにすることができます -

1. Add one "Lookup" component and pass output of "Excel source" to it. 
2. Edit "Lookup" component, and add second source of input to it from your existing table (where you have work email). 
3. Join these two inputs to "Lookup" component on the basis of one of the key columns, 
    so that in output you have two columns one email column from source and one email column from destination. 
3. Add "Derived column" component and pass output of "Lookup" to it. 
4. Edit "Derived Column", add new column and add expression to check whether email column has "@work-domain" or not. 
    If yes, then source email else destination email. 

私は説明することができます。 enter image description here

関連する問題