ssis lookup with derived columns?

混江龙づ霸主 提交于 2019-11-28 11:25:12

问题


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. 

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


回答1:


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.

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

Select cache mode

Define connection and your source query.

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



来源:https://stackoverflow.com/questions/7768025/ssis-lookup-with-derived-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!