码迷,mamicode.com
首页 > 其他好文 > 详细

SSIS Lookup 找不到匹配数据

时间:2014-08-06 19:12:42      阅读:398      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   io   文件   数据   

 

用户有一个需要用txt更新表数据的功能,用lookup实现,步骤:

 

1.       循环文件夹的txt文件

 

2.       Lookup 全部cache目标表数据,比对txt数据和目标表数据

 

bubuko.com,布布扣

 

3.       如果有match的数据用txt更新目标表

 bubuko.com,布布扣

但是执行每次Match的数据都是0,而txt中确实存在匹配的数据。翻了一下微软的BOL,有一句话很重要:

If there are multiple matches in the reference table, the Lookup transformation returns only the first match returned by the lookup query.If multiple matches are found, the Lookup transformation generates an error or warning only when the transformation has been configured to load all the reference dataset into the cache. In this case, the Lookup transformation generates a warning when the transformation detects multiple matches as the transformation fills the cache.

 

后来查了一下我的记录中确实记录都是重复,由于我选择了处理错误的方式“Redirect rows to no match output”,所以数据都到了Not match.

 

之后尝试将重复数据删除就正常了。因为考虑到大部分应用是数据仓库方面的,维度都是为一的,所以很少碰到这个问题。

 

还有一点要注意的是Lookup是大小写敏感的,在处理带有字符数据的时候要注意。

 

另外这个功能用上次提到的处理缓慢变化维的组件也可以实现。

 

SSIS Lookup 找不到匹配数据,布布扣,bubuko.com

SSIS Lookup 找不到匹配数据

标签:style   blog   http   color   os   io   文件   数据   

原文地址:http://blog.csdn.net/kevinsqlserver/article/details/38403355

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!