Explain the difference between trigger and stored procedure.- A stored procedure can accept parameters while a trigger cannot.
- A trigger can’t return any value while stored procedures can.
- A trigger is executed automatically on some event while a stored procedure needs to be explicitly called.
- Triggers are used for insertions, update and deletions on tables while stored procedures are often using independently in the database.
- A trigger cannot be written in a stored procedure. However, the reverse is not possible.
Explain the difference between trigger and stored procedure.- Trigger in act which is performed automatically before or after a event occur.
- Stored procedure is a set of functionality which is executed when it is explicitly invoked.
Explain the difference between trigger and stored procedure.Procedure runs only when one call them manually whereas a trigger runs when there is any activity (insert,update,delete) on table on which the trigger is written.