Tuesday, February 14, 2012

Does the UPDATE trigger fire when a record is updated or only when it is deleted?

I've gotten conflicting info about this in the past so I thought I'd try to get clarification.

When a record is deleted, I'm sure it fires the delete trigger. Does it also fire the update trigger?

ThanksThe update trigger doesnot fire on a delete.

however:

when an update occurs and the update trigger is fired, there are 2 virtual recordset that you can inspect to see what changed

inserted and deleted

the deleted recordset contains the old values
the inserted recordset contains the new values|||dpends on when you set the trigger to fire..could be update and/or delete and/or insert..


CREATE TRIGGER <trigger_name>
ON <table_name>
FOR DELETE, INSERT, UPDATE
AS ...

hth|||Thanks mbanavige. That's what I needed to know.

No comments:

Post a Comment