更新 SSIS OLEDB 目标中的行 [英] Update Rows in SSIS OLEDB Destination

查看:27
本文介绍了更新 SSIS OLEDB 目标中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据流过程,其中有一个 OLEDB 源和一个 OLEDB 目标,如下所示:

I have a data flow process where I have an OLEDB Source and an OLEDB Destination like below:

Source 合并来自两个临时表的数据并返回结果集(例如 50K 行).这 50K 行也存在于目标表中,但都是旧数据.

Source merges data from two staging tables and returns a result set (say, 50K rows). These 50K rows are present in the destination table as well but are old data.

SELECT * FROM staging1
UNION
SELECT * FROM staging2 

通常,在 OLEDB 目标中,我们将返回的数据集从源表插入到目标表,但在我的情况下,我必须用这些新的 50K 行更新旧的 50K 行.

Generally, in the OLEDB destination we insert the returned dataset from the source to destination table, but in my case I have to update the old 50K rows with these new 50K rows.

一种批量更新.

谁能告诉我我该怎么做?感谢您的帮助.

Can anyone please let me know how I can do that? I appreciate your help.

推荐答案

好吧,找到了解决我的问题的方法;使用 SQL 查询和 SSIS 中的 SQL 任务更新所有行,如下所示.如果他们将来面临同样的挑战,可以帮助他人.

Well, found a solution to my problem; Updating all rows using a SQL query and a SQL Task in SSIS Like Below. May help others if they face same challenge in future.

update Original 
set Original.Vaal= t.vaal 
from Original join (select * from staging1  union   select * from staging2) t 
on Original.id=t.id

这篇关于更新 SSIS OLEDB 目标中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆