4
Reply

Difference between Store Procedure and Trigger?

    We can have control over the Stored Procedures where as with Triggers we can't.

    Triggers are used to implement the Business Logic where as Stored Procedure can run over a network with different parameters (depends).

    Stored procedure normally used for performing tasks
    But the Trigger normally used for tracing and auditing logs.

    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.

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

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

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



    Store Procedure we need execute manually, trigger fired when the event is occured(insert ,delete,update,..etc).