Sunday 26 January 2014

Row level and statement level trigger

A trigger if specified FOR EACH ROW; it is fired for each of the table being affected by the triggering statement. For example if a trigger needs to be fired when rows of a table are deleted, it will be fired as many times the rows are deleted.
If FOR EACH ROW is not specified, it is application to a statement and the trigger is executed at a statement level.


Row Level Trigger
Row Level Trigger is fired each time row is affected by Insert, Update or Delete command. If statement doesn’t affect any row, no trigger action happens.
Statement Level Trigger
This kind of trigger fires when a SQL statement affects the rows of the table. The trigger activates and performs its activity irrespective of number of rows affected due to SQL statement.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More