Triggers

Stored Procedures

A Trigger is created in such a way that it fires when a specific event occurs. A group of sql commands that can be reused again and again are called stored procedures. They are created and stored in a database.
A trigger cannot be called or execute directly by a user.  Only when the corresponding events are fired, triggers are created. Stored procedures can be executed whenever wanted by using exec command.
Trigger cannot be scheduled. You can schedule a job to execute the stored procedure at a pre-defined time.
Calling a trigger within a trigger is not possible Calling a stored procedure within a stored procedure is possible
You cannot pass parameters as input. Inputs can be passed as parameters
 It does return a value Can return zero or n values.
In a trigger, we cannot perform any transactions You can use transactions within a stored procedure.

 

 

Categorized in: