问题描述
大家好,
我每天都会将增量数据加载到Staging表中。
I have incremental data loaded into the Staging table on a daily basis.
目前,我使用登台数据使用SQL(执行SQL任务和数据流)在目标表上执行插入/更新/删除
Currently, i use the staging data to perform insert/update/delete on the destination table using SQL(Execute SQL task and data flow)
但是我想将进程移动到SSIS,以便能够根据登台数据插入/更新目标表,而不必使用eexcute sql任务插入/更新,
but i want to move the process to SSIS, to be able to insert/update the destination table based on the staging data wihout having to use eexcute sql task for insert/update,
请指导有助于实现结果的现有SSIS任务,非常感谢
Please guide on existing SSIS tasks that help to achieve the outcome, thanks very much
推荐答案
不幸的是,SSIS没有UPSERT目的地已经开箱即用。
Unfortunately, SSIS doesn't have UPSERT Destination out-of-the-box.
很久以前,一位微软实习生在SSIS开发。团队将其实施为 概念验证(POC),但它从未将其纳入实际产品。
Long time ago one Microsoft intern on the SSIS dev. team implemented it as a Proof of Concept (POC), but it never made it into the actual product.
这就是为什么最佳选择分为两步:
That's why the best option is a 2 step process:
- 通过SSIS 数据流任务将增量数据插入临时表。
- 使用SSIS 执行SQL 任务通过
T-SQL MERGE 语句一次性插入和更新目标表。
- Insert incremental data into a staging table via SSIS Data Flow Task.
- Use SSIS Execute SQL Task to INSERT and UPDATE target table in one shot viaT-SQL MERGE statement.
这篇关于基于临时数据删除/插入/更新的SSIS包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!