Difference between Triggers and Stored Procedure

Answer Posted / bed singh

1. Triggers can only be implemented on tables or views but
Stored Procedure in independent code that can be specific
to database.

2. Triggers are automatically run but stored procedures are
not automatically run and they have to be called explicitly
by the user.

3. we can write a stored procedure within a trigger but
cannot write a trigger within a stored procedure.

4. Trigger is attached to table or view and is fired only
when an INSERT, UPDATE, and/or DELETE occurs, while a
stored procedure executes at any time when it is called.

Is This Answer Correct ?    75 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the command used to check locks in microsoft sql server?

718


Suggest a method of joining two tables.

809


What is difference between rownum and row_number?

690


What are different types of roles provided by ssrs?

128


Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?

731






What is dirty page?

721


What is the size of transaction log file?

657


What extended events?

763


How can you check the level of fragmentation on a table?

770


Do you know the cursor optimization tips?

744


how to control the amount of free space in your index pages? : Sql server database administration

759


What is use of except clause? How it differs from not in clause?

755


What are the steps to follow to configure SQL*Net?

771


How to add a new dsn with the odbc driver for sql server?

735


What is Cross Join and in which scenario do we use Cross Join?

770