Trigger Advantage And Disadvantage


The trigger is a special kind of store procedure that executes in response to certain actions on the table like insertion, updating, or, deletion of data.
Trigger stored program. The trigger is an automatic fire when any operation occurs on the database.

Advantage of Trigger:
  • You can have the logic you wish to implement in a single place instead of writing it in multiple stored procedures.
  • It is very much useful when we use it to audit the change in the data in a database table.
  • It provides an alternative way to run the scheduled task.
  • Using trigger we don't have to wait to run the scheduled task. that automatically fires that task before or after changes are made to the database table.
  • Improve performance in the client/server environment. 
The disadvantage of Trigger:
  • It is easy to view table relationships, constraints, index, and stored procedures but triggers are difficult to view.
  • The trigger is run every time update table and it makes the system run slower.
  • A trigger can provide extended validation and it cannot be replaced with all the validations.
  • Trigger executes invisibly from the client application so it is hard to understand what happens at the database layer.
  • The trigger doesn't scale in a cost-effective manner as the traffic increases.
  • Data manipulation (insert, update, delete) often requires a lock on the table and even on an index that impedes other users' access to data.