Difference between Triggers and Stored Procedure

Answer Posted / ajay panchal

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

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

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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?

529


What is triggers and its types?

547


What is difference between sql and sql server?

546


What are the difference between primary key and unique key? : sql server database administration

529


what is the difference between delete table and truncate table commands? : Sql server database administration

525






What is a primary index?

529


What is the difference between osql and query analyzer?

546


What is the maximum length of an alert name?

606


How to verify a user name with sqlcmd tool?

587


What is mapping schema?

586


What is model database? : SQL Server Architecture

574


What is query optimization process?

522


what is bit datatype and what's the information that can be stored inside a bit column? : Sql server database administration

541


What is the use of partition by in sql server?

515


What are the difference between “where” and “having” clause in sql server?

587