Friday, January 31, 2014

Difference between Trigger and Stored Procedure

Difference between Trigger and Stored Procedure:
 
1. Stored procedure normally used for performing tasks. But the Trigger normally 
    used for tracing and auditing logs.

2. Stored procedures should be called explicitly by the user in order to 
   execute. But the Trigger should be called implicitly based on the events defined in the table.

3. Stored Procedure can run independently
    But the Trigger should be part of any DML events on the table.

4. Stored procedure can be executed from the Trigger
    But the Trigger cannot be executed from the Stored procedures.

5. Stored Procedures can have parameters.
    But the Trigger cannot have any parameters

No comments:

Post a Comment