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
How to create a stored procedure with a statement block in ms sql server?
What is the difference between a primary key and a unique key? Are they the same?
Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?
What is explicit cursors?
How to disable a login name in ms sql server?
What is candidate key with example?
What are Row versions of DataRow?
Explain magic tables in sql server?
What is inline table-value user-defined function?
Will count(column) include columns with null values in its count?
What are the basic features of a trigger in ms sql server?
How can we get count of the number of records in a table?
What are statistics?
Difference between Inner vs outer joins?
What are dml (data manipulation language) statements in ms sql server?