What is CrazyEngico.com (CE)?

CrazyEngico (CE) is a one-stop solution for interview questions and answers, domain knowledge, e-learning, tutorials, articles and many more learning material.
e-learning - Intelligent e-learning tutorials and articles
Domain Knowledge Learn about various business domains/verticals such as Banking, Financial, Insurance, Healthcare and many more...
Interview Questions and Answers - Post your questions and answers. 1000+ database of ready questions and answers available to prepare for an interview.
Tutorials - 300+ video tutorials from beginner to expert level.
Articles - 300+ technical articles to understand concepts.
Forum - A technical forum to post your queries/responses.

Search Questions

Interview Questions/Answers

Ads
Question
Interview Q & A >> SQL Server >> Difference between Trigger and Stored Procedure

<< Previous Question Navigator Next >>

0        0
Difference between Trigger and Stored Procedure (Views: 2342)


Answers

0        0

Trigger will get execute automatically when an UPDATE, INSERT, or DELETE statement is issued against a table or view.
We have to call stored procedure manually, or it can execute automatic when the SQL Server starts (You can use the sp_procoption system stored procedure to mark the stored procedure to automatic execution when the SQL Server will start.

Submitted By: Anonymous | Created On: 5/16/2009 5:07:46 PM


1        0

A stored procedure can accept parameters while a trigger cannot.
A trigger can’t return any value while stored procedures can.
A trigger is executed automatically on some event while a stored procedure needs to be explicitly called.
Triggers are used for insertions, update and deletions on tables while stored procedures are often using independently in the database.
A trigger cannot be written in a stored procedure. However, the reverse is not possible.

Submitted By: krishna raghuwanshi | Created On: 2/5/2011 12:06:35 PM

0        0

1. Triggers are implicitly called by DB itself while SP has to be manually called by user.

2. SP can pass the parameters which is not a case with Triggers.

3. While creating a Trigger, triggering event n action has to be specified, which isn’t a case with SP.

4. A Trigger can call the specific SP in it but the reverse is not true.

Submitted By: Thirupathi | Created On: 8/8/2011 12:05:08 AM


Post your Answer
Your answer will be first reviewed by our administrator before it appears on the site.

Your Answer:


 
Display Name:





By clicking on Submit button you agree to the Terms of Service agreement.




Copyright © 2018 CrazyEngico.com. All rights reserved.
CrazyEngico.com is not responsible for the content and CrazyEngico.com does not evaluate or guarantee the accuracy of any CrazyEngico.com content.
Please read our terms of service agreement before using this site.

feedback