问题描述
我有一个带有 OLE DB 目标组件的 SSIS 数据流任务,该组件使用触发器将记录插入到表中.当我对该表执行正常的 INSERT
语句时,触发器会触发.当我通过 SSIS 任务插入记录时,触发器不会触发.
I have an SSIS data flow task with an OLE DB Destination component that inserts records into a table with a trigger. When I execute a normal INSERT
statement against this table, the trigger fires. When I insert records through the SSIS task the trigger does not fire.
如何在 SSIS 中触发触发器?
How can I get the trigger firing in SSIS?
推荐答案
因为 OLE DB 目标任务使用批量插入,所以默认情况下不会触发触发器.来自 批量插入 (MSDN):
Because the OLE DB Destination task uses a bulk insert, triggers are not fired by default. From BULK INSERT (MSDN):
如果未指定 FIRE_TRIGGERS,则不会执行插入触发器.
必须通过其高级编辑器手动将 FIRE_TRIGGERS 指定为 OLE DB 组件的一部分.
One must manually specify FIRE_TRIGGERS as part of the OLE DB component through its Advanced Editor.
然后将FIRE_TRIGGERS"添加到FastLoadOptions的值中(注意选项是逗号分隔的):
Then add "FIRE_TRIGGERS" to the value of FastLoadOptions (note that options are comma-separated):
使用该选项后,触发器应在任务执行期间触发.
With that option in place, the triggers should fire during the task's execution.
这篇关于为什么在 SSIS 插入期间我的触发器没有触发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!