Difference between Triggers and Procedures ?

March 6, 2022, 2:20 p.m.


Stored procedure can take input parameters, but we can't pass parameters as input to a trigger.

Stored procedure can return values but a trigger cannot return a value.

Stored procedure can take input parameters, but we can't pass parameters as input to a trigger.

Stored procedure can return values but a trigger cannot return a value.

We can execute a stored procedure whenever we want with the help of the exec command but a trigger can only be executed whenever an event (insert, update or delete) is fired on the table on which the trigger is defined.

We can use transaction statements like begin transaction, commit transaction and rollback inside a stored procedure but we can't use transaction statement inside a trigger.

 



Tags


Comments