视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
SSISLookup找不到匹配数据
2020-11-09 14:58:39 责编:小采
文档

用户有一个需要用txt更新表数据的功能,用lookup实现,步骤: 1. 循环文件夹的txt文件 2. 用Lookup 全部cache目标表数据,比对txt数据和目标表数据 3. 如果有match的数据用txt更新目标表 但是执行每次Match的数据都是0,而txt中确实存在匹配的数据。翻了一下

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

1. 循环文件夹的txt文件

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

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

但是执行每次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是大小写敏感的,在处理带有字符数据的时候要注意。

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

下载本文
显示全文
专题