Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Triggers and DTS's

Author  Topic 

Helgor
Starting Member

1 Post

Posted - 2007-07-23 : 07:24:13
Hi,

I have a trigger that fires on a table when records are inserted/updated. It then moves certain values from the insert into another table. This all works fine when I do it manually but the trigger doesn't fire when the dts runs (im presuming because its a bulk import).

Is there any way around this? I need to have this trigger firing each time a record is added.

Thanks

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2007-07-23 : 08:29:14
BULK INSERT overview i BOL:
quote:
Trigger Execution
All bulk copy operations (the BULK INSERT statement, bcp utility, and the bulk copy API) support a bulk copy hint, FIRE_TRIGGERS. If FIRE_TRIGGERS is specified on a bulk copy operation that is copying rows into a table, INSERT and INSTEAD OF triggers defined on the destination table are executed for all rows inserted by the bulk copy operation. By default, bulk copy operations do not execute triggers.

These considerations apply to bulk copy operations that specify FIRE_TRIGGERS:

Bulk copy operations that would usually be minimally logged are fully logged.

Triggers are fired once for each batch in the bulk copy operation. The inserted table passed to the trigger contains all of the rows inserted by the batch. Specify FIRE_TRIGGERS only when bulk copying into a table with INSERT and INSTEAD OF triggers that support multiple row inserts.

No result sets generated by the insert triggers are returned to the client performing the bulk copy operation.


--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page
   

- Advertisement -