使用派生列进行 ssis 查找? [英] ssis lookup with derived columns?

查看:19
本文介绍了使用派生列进行 ssis 查找?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想确保我这样做是正确的.

I just want to make sure i am doing this correctly.

Derived columns:

car
truck


Lookup (after derived column:)

1.Query: select * from dbo.store where A = ? and B = ?.  

2.In column mapping/or advanced parameters I map car to A and truck to B. 

正确吗?我问这个是因为我不断收到 OLE 错误.

Correct? I ask this because I keep getting an OLE error.

推荐答案

虽然我正在等待收到错误消息的回复,但此时我的假设是您正在使用 查找组件 不正确.您的查询语法假定将对流经组件的每一行执行一个查询.

While I'm waiting to hear back on the error message, my assumption at this point is that you are using the lookup component incorrectly. Your query syntax presumes there will be a query executed for every row flowing through the component.

查找组件使用默认配置的方式是,在预执行事件期间,查询针对目标数据库运行,并且所有结果被拉回.这就是为什么作为一般最佳实践,您应该只拉回您需要的列.然后将查询结果缓存在本地并在查找任务中用作字典式查找.

The way the lookup component works with default configuration is that during the pre-execute event, the query is run against the target database and all the results are pulled back. Which is why as a general best practice, you should only pull back the columns you need. The query results are then cached locally and used in the lookup task as a dictionary-style lookup.

这些屏幕在 2005 年和 2008 年之间发生了变化,但您可以弄清楚.

These screens change between 2005 and 2008 but you can figure it out.

选择缓存模式

定义连接和源查询.

连接列.这就是它如何找到匹配项而不是您尝试的参数化方法.在这个例子中,我将卡车和汽车连接到 A 和 B 并检索 foo 列

Wire up columns. This is how it will find matches instead of the parameterization method you were attempting. In this example, I am connecting truck and car to A and B and retrieving the foo column

这篇关于使用派生列进行 ssis 查找?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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