开发者

SSIS lookup with Update possible?

开发者 https://www.devze.com 2023-04-05 15:44 出处:网络
I am converting a DTS update lookup to an SSIS lookup with an update query. So far it doesn\'t seem to work.

I am converting a DTS update lookup to an SSIS lookup with an update query. So far it doesn't seem to work.

OLD DTS ACTIVE X CODE:

va开发者_如何学编程lue = DTSLookups("apple").Execute(DTSSource("ID2"))

SQL Query in DTS:

UPDATE TABLE1 SET STAMP="TEST" WHERE (ID = ?)

In SSIS:

Create a lookup, use same above query, and I get an error if I click on column: "Parameter information cannot be derived from SQL statements. Set parameter information before preparing command"

IS there anyway to accomplish this in SSIS with a lookup? Or is there a better way?


Old way

To perform updates in SSIS, you will want to look at the OLE DB transformation as it will allow you to do the update as expected.

Better way

You however don't want to use OLE DB transformation as it will fire off singleton update statements for every bloody row flowing through a dataflow and your performance will be abysmal. Instead, for all the rows needed updated, use a conditional split and redirect them into a staging table. After the dataflow, wire up an execute SQL task to perform a mass update of all the rows that need to be fixed. Your database will thank you. Andy Leonard is a great resource to start with, here's an article he did that describes his incremental load pattern

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号