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

How to create a stored procedure with a statement block in ms sql server?

572


What is the difference between a primary key and a unique key? Are they the same?

540


Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?

851


What is explicit cursors?

555


How to disable a login name in ms sql server?

589






What is candidate key with example?

512


What are Row versions of DataRow?

604


Explain magic tables in sql server?

547


What is inline table-value user-defined function?

588


Will count(column) include columns with null values in its count?

666


What are the basic features of a trigger in ms sql server?

565


How can we get count of the number of records in a table?

544


What are statistics?

566


Difference between Inner vs outer joins?

531


What are dml (data manipulation language) statements in ms sql server?

549