SSIS: Dynamic Lookup Query

点点圈 提交于 2020-01-15 11:45:27

问题


I would like to implement the following logic to my Lookup query as an expression:

SELECT  ID,
        CASE @[User::ConnectionStringID]
        WHEN 1 THEN "NE"
        WHEN 2 THEN "BALT"
        WHEN 3 THEN "NY" 
        WHEN 4 THEN "PA"
        END AS Region
FROM    dbo.Table;

My package is executed in a loop where the connection string is dynamically updated using a config file and it loops 4 times as shown in the above logic.

I realized today that the Lookup transformation has no expressions available to it and I haven't been able to find another suitable solution. Has anyone found a way around this or a custom transformation script?


回答1:


Lookup control has expressions, but cannot accessed directly from it just go to your Dataflowtask properties and access the expressions like shown in the image below



来源:https://stackoverflow.com/questions/42032542/ssis-dynamic-lookup-query

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