Sponsored Links

Interview Questions
Recommended Books












INTERVIEW QUESTIONS DATABASE SQL DETAILS
Question :

Difference between Stored Procedure and Trigger

Category SQL Interview Questions
Rating (3.2) By 67 users
Added on 8/12/2011
Views 5296
Rate it!

Highly Recommended, Hand Picked SQL Books



Question :

Difference between Stored Procedure and Trigger


Answer:

Information related to Stored procedure you can see in USER_SOURCE,USER_OBJECTS(current user) tables.

Information related to triggers stored in USER_SOURCE,USER_TRIGGERS (current user) Tables.

Stored procedure can't be inactive but trigger can be Inactive.

Source: CoolInterview.com



we can call stored procedure explicitly.

but trigger is automatically invoked when the action defined in trigger is done.
ex:
create trigger <trig_Name> after Insert on <table>


this trigger invoked after we insert something on that table.


Source: CoolInterview.com



Posted by: sathyaajh

Contact sathyaajh Contact sathyaajh

Triggers are used to initiate a particular activity after fulfilling certain condition.It need to define and can be enable and disable according to need.
Source: CoolInterview.com



Posted by: Amit

Contact Amit Contact Amit

Triggers get invoked automatically when the event specified in it gets fulfilled, it can't return any value.So user have no control over it's invocation.Whereas stored procedure can be called as per application requirement and can get output parameters.
Source: CoolInterview.com



Posted by: nilambari

Contact nilambari Contact nilambari

stored procedure is a block of code contains sql statements.
stored procedure is a precompiled block of code,which need not be compiled for every time calling.

trigger is a user defined constraint it has to be called when situation araises.
Source: CoolInterview.com



Posted by: pushpa g

Contact pushpa g Contact pushpa g

Triggers once defined are called automatically, there can be no explicit invocation
Stored procedure has to be called explicitly, moreover procedures can return values, triggers can't
Source: CoolInterview.com



Posted by: mahendra

Contact mahendra Contact mahendra

Stored procedure used to perform operation. but trigger used to prevent operation.
Source: CoolInterview.com



Posted by: Roobesh

Contact Roobesh Contact Roobesh

1. trigger doesnot except argument
but store procedure does.
2. trigger cannot be local and store as a stand alone object in database.
but store procedure can be store in package.
3. Trigger execute implicitly whereas store procedure execute via
procedure call from another block.



Source: CoolInterview.com



Posted by: Nitin

Contact Nitin Contact Nitin

you will have to call stored procedure but trigger automatically called
Source: CoolInterview.com



Posted by: Shabbir Alam

Contact Shabbir Alam Contact Shabbir Alam

PROCEDURE-> means it will call the specified function,when we assumed it before.procedure is active.
TRIGGER-> trigger are active for after fulfilling the specified conditions.
Source: CoolInterview.com



Posted by: sandhya

Contact sandhya Contact sandhya

We can call stored procedure explicitly.but Trigger is invoked implicitly.

procedures are invoked by the user whereas triggers are invoked by the system.

procedure can be created with out a table but a trigger can't be created with out table.

procedures accept parameters where as triggers can't.

procedures return a value,triggers can't return any value.
Source: CoolInterview.com



Posted by: ajay

Contact ajay Contact ajay

commit,savepoint and rollback
are not allowed in triggers.
We can write commit,savepoint and rollback in procedures.
Source: CoolInterview.com



Posted by: Milind

Contact Milind Contact Milind

Triggers are used to initiate a particular activity after fulfilling certain condition.It need to define and can be enable and disable according to need.



Source: CoolInterview.com



Posted by: william

Contact william Contact william

commit,savepoint and rollback
are not allowed in triggers.
We can write commit,savepoint and rollback in procedures.

But we can add commit,rollback in trigger by adding next Line:
Autonomous Transaction

Source: CoolInterview.com



Posted by: Swapnil Bhosale

Contact Swapnil Bhosale Contact Swapnil Bhosale

Stored procedures are used to perform a task and should be invoked explicitly using exec.
Triggers are used to restrict invalid transactions and invokes(fires) implicitly when an dml manipulation happens
Source: CoolInterview.com



Posted by: kiran

Contact kiran Contact kiran

A Stored Procedure is set of pre-compiled sql statements which are stored in memory. These statements are executed by executing that procedure which display results based on arguments passed to that procedure.

A trigger is invoked automatically when any operation (insertion,deletion and updation) is performed on particular table.Triggers are used to record events performed on table.
Source: CoolInterview.com



Posted by: Rajiv

Contact Rajiv Contact Rajiv

If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification Enter the above shown code: *
Inform me about updated answers to this question

Related Questions
View Answer
When using a count(disitnct) is it better to use a self-join or temp table to find redundant data, and provide an example?

View Answer
What is the advantage to use trigger in your PL?

View Answer
What the difference between UNION and UNIONALL?

View Answer
How to find second maximum value from a table?

View Answer
How to display duplicate rows in a table?

View Answer
What is joint?

View Answer
What is the difference between TRUNCATE and DELETE commands
View Answer
Which system table contains information on constraints on all the tables created?
View Answer
Which command displays the SQL command in the SQL buffer, and then executes it
View Answer
What does the following query do



View Answer
What will be the output of the following query

View Answer
TRUNCATE TABLE EMP;

DELETE FROM EMP;

Will the outputs of the above two commands differ


View Answer
What is the difference between Single row sub-Query and Scalar sub-Query

View Answer
How do I write a cron which will run a SQL query and mail the results to a group?

View Answer
Is there any query which is used to find the case sensitivity in each records in database through visual basic?

View Answer
I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.

View Answer
How to copy sql table.

View Answer
Difference between Store Procedure and Trigger

View Answer
Cursor Syntax brief history

View Answer
Explain normalization with examples.

View Answer

Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

View ALL SQL Interview Questions & Answers



User Options
India News Network

Latest 20 Questions
What are the Hadoop related Projects at Apache?
What are the modules included in Apache Hadoop Project?
What is Apache Hadoop?
What is a Private Cloud? Do we need one to handle Big Data?
How Can We Cope with the Impact of Big Data?
What skills do Big Data analysts need to have?
What does a Big Data analyst do?
What are some real-world examples of Big Data and how it is used?
What is Big Data Analytics?
Why Big Data is becoming so important?
What is the impact of Big Data on Sports Industry?
What is the impact of Big Data on Real estate Industry?
What is the impact of Big Data on Retail Banking Industry?
What is the impact of Big Data on Retail Industry?
What is the impact of Big Data on Technology Industry?
What is the impact of Big Data on Information Technology Industry?
What is the impact of Big Data on Internet of Things (IoT) Industry?
What is the impact of Big Data on Media Industry?
What is the impact of Big Data on Education Industry?
What is the impact of Big Data on Healthcare Industry?



Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions



Cache = 0.007812 Seconds