Interviews2 answers
What is difference between the stored Procedure and trigger?
Brijesh Jalan
Posted Jul 15, 2010, 1:39 AM EDT2 Answers
2. ) In SP you can pass parameter But in trigger you can't
3. ) we explicitly call the Sp when Trigger are implicitly
fired
4. ) you can write a sp in Trigger but in a Trigger you cant
write SP.
5.) Trigger written on an individual Table or View where SP
is written for an Database
Store Procedure:-
1.Store procedure is a named group of sql statement that is previously created and stored in sql data base.
2.Store Procedure is pre compiled
3.Store procedure can have insert,select,delete,update and search statement.
4.when you want to modify logic inside procedure you can do it without affecting any client.changes will reflect immediatly.
Trigger:-
1.Trigger is special type of store procedure that responds on specific events like as Insert,Update or Delete.
2.You can not force trigger directly.it automatically responds when corresponding action take place on that table where it defined.
3.Triggers are managed by DBMS.
4.Triggers are used to maintain referiantel Integrity of data base.
