SSIS 将派生列更新为 table

SSIS Update derived columns to table

我一直在尝试修复错误字段中的一些数据错误,并且我设法通过派生列来完成。我的派生列由那些已修复的字段组成。我怎样才能将它们更新到现有的 table 行中,其中包含错误放置字段的错误?

假设您有 table Test,源 table 中的列 col_pk、col1、col2、col3、col4。 col_pk 是主键,col1col3 有错误。

I am assuming by "existing table rows which contains those errors of wrong placed fields" you want to update the same table you are using in your OLE DB Source

现在,在派生列转换之后,您已经更正了错误并且有 2 个新列 col1_new 和 col3_new

(You can also give them the same name and replace existing columns, this replace will be SSIS internal and won't effect your database, writing this as I was not clear by question and you might be confused in this replace)

您现在需要做的事情:

  1. 创建一个 OLE DB 目标任务,link 派生列转换的输出作为其输入
  2. 在任务中,创建一个新的 table,比如 Test_new。它将根据 OLE DB 目标的输入为您提供自动创建选项。 (您只需要将 col_pk、col1_new 和 col3_new 映射到目的地)
  3. 在控制流中,创建一个执行 SQL 任务并编写一个查询来更新测试 table,例如:

    更新测试

    SET col1 = Col1_new,col2 = Col2_new

    来自测试

    内连接Test_new

    ON Test.col_pk = Test_new.col_pk

就这些了!