trigger does not fire when inserting via DTS

trigger does not fire when inserting via DTS

Post by Tanj » Thu, 22 Mar 2001 23:13:37



Hi,
I have written a triger on a base table that inserts changed and inserted
rows from the base table into a history table. It works fine when I insert
or update records from QA or directly in the base table.
But, when I create and run a DTS package that inserts rows into the base
table, the TRIGGER DOESN'T FIRE!
Please give me any suggestions how is this possible and how to prevent it.
Regards, Tanja

 
 
 

trigger does not fire when inserting via DTS

Post by Tom Morea » Thu, 22 Mar 2001 23:58:16


Depending on how you are inserting the rows, the triggers may not fire.  If
the insert is the result of a bulk insert, the triggers will not normally
fire unless you turn on the Fire Triggers option.

--
   Tom

----------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT
Columnist, SQL Server Professional

Toronto, ON Canada
www.pinnaclepublishing.com/sql
www.apress.com
---
Hi,
I have written a triger on a base table that inserts changed and inserted
rows from the base table into a history table. It works fine when I insert
or update records from QA or directly in the base table.
But, when I create and run a DTS package that inserts rows into the base
table, the TRIGGER DOESN'T FIRE!
Please give me any suggestions how is this possible and how to prevent it.
Regards, Tanja


 
 
 

trigger does not fire when inserting via DTS

Post by Tanj » Fri, 23 Mar 2001 22:12:42


Thanks for the respond, but is it possible to make the triger fire no matter
of the method used to insert the data. I am the owner of the table and the
trigger and I need to define the behaviour of the trigger in any case. The
other users may create and execute the DTS packages or use other mathodes of
insertion. Therefore I can not control the other users and for the sake of
consistency and security I need the trigger to fire independantly of the
method used for insertion.
Please give me some further suggestions!
Regards,Tanja


> Depending on how you are inserting the rows, the triggers may not fire.
If
> the insert is the result of a bulk insert, the triggers will not normally
> fire unless you turn on the Fire Triggers option.

> --
>    Tom

> ----------------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT
> Columnist, SQL Server Professional

> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
> www.apress.com
> ---

> Hi,
> I have written a triger on a base table that inserts changed and inserted
> rows from the base table into a history table. It works fine when I insert
> or update records from QA or directly in the base table.
> But, when I create and run a DTS package that inserts rows into the base
> table, the TRIGGER DOESN'T FIRE!
> Please give me any suggestions how is this possible and how to prevent it.
> Regards, Tanja


 
 
 

trigger does not fire when inserting via DTS

Post by Tom Morea » Fri, 23 Mar 2001 22:56:56


What you can do is use DTS to load a scratch table with the data, then have
it execute a stored proc that does an insert from the scratch table to the
target table.  The trigger will then fire.

--
   Tom

----------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT
Columnist, SQL Server Professional

Toronto, ON Canada
www.pinnaclepublishing.com/sql
www.apress.com
---
Thanks for the respond, but is it possible to make the triger fire no matter
of the method used to insert the data. I am the owner of the table and the
trigger and I need to define the behaviour of the trigger in any case. The
other users may create and execute the DTS packages or use other mathodes of
insertion. Therefore I can not control the other users and for the sake of
consistency and security I need the trigger to fire independantly of the
method used for insertion.
Please give me some further suggestions!
Regards,Tanja


> Depending on how you are inserting the rows, the triggers may not fire.
If
> the insert is the result of a bulk insert, the triggers will not normally
> fire unless you turn on the Fire Triggers option.

> --
>    Tom

> ----------------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCT
> Columnist, SQL Server Professional

> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
> www.apress.com
> ---

> Hi,
> I have written a triger on a base table that inserts changed and inserted
> rows from the base table into a history table. It works fine when I insert
> or update records from QA or directly in the base table.
> But, when I create and run a DTS package that inserts rows into the base
> table, the TRIGGER DOESN'T FIRE!
> Please give me any suggestions how is this possible and how to prevent it.
> Regards, Tanja


 
 
 

1. trigger does not fire when inserting via DTS

Hi,
I have written a triger on a base table that inserts changed and inserted
rows from the base table into a history table. It works fine when I insert
or update records from QA or directly in the base table.
But, when I create and run a DTS package that inserts rows into the base
table, the TRIGGER DOESN'T FIRE!
Please give me any suggestions how is this possible and how to prevent it.
Regards, Tanja

2. Import taking a long time.

3. Trigger not firing via DTS (slightly educated Newbie - LOL)

4. SQL Query Output

5. SQL Server 2000 bug: DTS import does not fire insert trigger

6. Importing IBM Personal Assistant filing files (?)

7. bulk insert not firing insert triggers

8. Help With If..else..endif

9. trigger do not fire when doing bulk update

10. Trigger trouble - fired via DTS

11. SQL7, DTS, Insert Trigger won't fire

12. Triggers do not fire on Insert Into ....

13. bulk insert triggers not fired for update