Why aren't my triggers firing during an insert by SSIS?

夙愿已清 提交于 2019-12-02 23:47:20

Because the OLE DB Destination task uses a bulk insert, triggers are not fired by default. From BULK INSERT (MSDN):

If FIRE_TRIGGERS is not specified, no insert triggers execute.

One must manually specify FIRE_TRIGGERS as part of the OLE DB component through its Advanced Editor.

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.

complementing ladenedge's answer.

Because the OLE DB Destination task uses a bulk insert, triggers are not fired by default

that is true when you have the "fast load" option selected.

If you change it to a regular "table or view" data access mode, your triggers should fire normally because the insert is done row-by-row

You can do this without using SQL Server Data Tool for Visual Studio by editing the dtsx File with Notepad (or any other Text editors).

Search for the following property:

<property
 dataType="System.String"
 description="Specifies options to be used with fast load.  Applies only 
 if  fast load is turned on."
 name="FastLoadOptions">
      TABLOCK,CHECK_CONSTRAINTS
</property>

and add the value FIRE_TRIGGERS as Diego already described.

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