Trigger Insert on a table

Trigger Insert on a table

Post by BUYCK Jack » Sat, 05 Sep 1998 04:00:00



Hello,

    I've a problem with an insert trigger on a table :

    I must execute a command each time a row is inserted in my table ! To
perform that, i've make a trigger Insert !
    But I failed to take all the new entries inserted ! I use the inserted
table but I can just take the last insert !

    Is there an while instruction in SQL taht give me all line inserted or
what can I do to perform this action ! (For all entry I must take the values
and put them in a command line )

    Thanks for your response !

    Jack

 
 
 

Trigger Insert on a table

Post by Mikael Wedha » Sat, 05 Sep 1998 04:00:00


The table inserted includes ALL rows inserted in the command wich caused the
trigger to fire. You'll have to create some code to deal with this. A cursor
would do the job of looping through each row, however I think it's better to
do it with a subquery instead. It depends on what you want to do with the
rows.

/micke


>Hello,

>    I've a problem with an insert trigger on a table :

>    I must execute a command each time a row is inserted in my table ! To
>perform that, i've make a trigger Insert !
>    But I failed to take all the new entries inserted ! I use the inserted
>table but I can just take the last insert !

>    Is there an while instruction in SQL taht give me all line inserted or
>what can I do to perform this action ! (For all entry I must take the
values
>and put them in a command line )

>    Thanks for your response !

>    Jack


 
 
 

Trigger Insert on a table

Post by BUYCK Jack » Tue, 08 Sep 1998 04:00:00



>The table inserted includes ALL rows inserted in the command wich caused
the
>trigger to fire. You'll have to create some code to deal with this. A
cursor
>would do the job of looping through each row, however I think it's better
to
>do it with a subquery instead. It depends on what you want to do with the
>rows.

I just want to take some informations like a loginName and a message that
are contain in a table that I use for history !
These informations are used in a command line to send a message to the
people name "loginName" !
>/micke


>>Hello,

>>    I've a problem with an insert trigger on a table :

>>    I must execute a command each time a row is inserted in my table ! To
>>perform that, i've make a trigger Insert !
>>    But I failed to take all the new entries inserted ! I use the inserted
>>table but I can just take the last insert !

>>    Is there an while instruction in SQL taht give me all line inserted or
>>what can I do to perform this action ! (For all entry I must take the
>values
>>and put them in a command line )

>>    Thanks for your response !

>>    Jack

 
 
 

1. Trigger Insert on a table

Hello,

    I've a problem with an insert trigger on a table :

    I must execute a command each time a row is inserted in my table ! To
perform that, i've make a trigger Insert !
    But I failed to take all the new entries inserted ! I use the inserted
table but I can just take the last insert !

    Is there an while instruction in SQL taht give me all line inserted or
what can I do to perform this action ! (For all entry I must take the values
and put them in a command line )

    Thanks for your response !

    Jack

2. ADO architecture

3. update triggers: Inserted and Deleted tables

4. PickUp is a StickUp -- How About These Changes?

5. Trigger Inserted and Deleted Tables

6. SQL7 Profiler problem

7. Trigger Insert on a table

8. GMT - Standard Time/Daylight Time

9. Newbie - Triggering Insert Into Subcategory Table

10. Row Triggers, Insert and mutating table

11. Insert trigger: inserted table empty!!!!!

12. insert trigger and the inserted table

13. trigger for insert on a table and bcp is inserting records