triggers

vathan

New member
Joined
Apr 2, 2005
Messages
2
hello

i need to create a trigger for DELETE, UPDATE and INSERT in all the Tables...
can i put it all in a Single Trigger....
if so how to achieve it....

and one more....i need to fine out the TRIGGER ACTION for which the TRIGGER is fired (i.e INSERT or DELETE or UPDATE)....i need to insert a code in that trigger to identify this....

Can u please help me in this..
Your Help is highly appreciated

Vathan
 
If you are using MS SQL then you can create a trigger using code like
Code:
CREATE TRIGGER <trigger name here> ON <table name here>
FOR INSERT, UPDATE, DELETE 
AS
--body of trigger goes here

within the body of the trigger you would then access two tables (inserted and deleted) which contain the modified rows.

It may help if you give a bit more detail about what you want the trigger to do.
 
Back
Top