1. dts导入数据到临时表2. 执行sql脚本任务, 用sql语句处理 --更新已经存在的 update a set col1=b.col2, col2= b.col2, .... coln=b.coln from 目的表 a, 导入的临时表 b where a.keycol = b.key col -- 导入不存在的 insert 目的表 select * from 导入的临时表 b where not exists( select * from 目的表 a where a.keycol = b.key col)3. 删除临时表
同意邹老大的观点 ”update a set col1=b.col1, col2= b.col2, .... coln=b.coln“
--更新已经存在的
update a set col1=b.col2, col2= b.col2, .... coln=b.coln
from 目的表 a, 导入的临时表 b
where a.keycol = b.key col
-- 导入不存在的
insert 目的表 select * from 导入的临时表 b
where not exists(
select * from 目的表 a where a.keycol = b.key col)3. 删除临时表
”update a set col1=b.col1, col2= b.col2, .... coln=b.coln“
一个数据流
一个源数据源
一个目标数据源
一个oledb命令组件
一个查找转换组件, 根据keycol查找, 查找成功的转到oledb命令组件执行update
查找失败的, 通过重定向, 直接插入目标数据源