Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 6437 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > SQL Server Interview Questions > Can we call a Trigger in store procedure ...

Can we call a Trigger in store procedure ?

Interview question and answer by: Bharathi Cherukuri | Posted on: 4/30/2012 | Category: SQL Server Interview questions | Views: 949 | | Points: 40


Answer:

We cannot call a trigger explicitly from a Stored Procedure as it is also a special kind of Stored Procedure.
A Trigger will fire automatically on the happening of an event like before or after insert, update or delete.

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


 Responses

Posted by: Muhsinathk | Posted on: 13 Sep 2012 04:47:52 AM | Points: 10 | Alert Moderator 

Within a sp you cannot call atrigger

Differences between storedprocedures and triggers
1. When you create a trigger you have to identify event and action of your trigger but when you create s.p you don't identify event and action

2.Trigger is run automatically if the event is occured but s.p don't run automatically but you have to run it manually

3. Within a trigger you can call specific s.p but within a sp you cannot call atrigger

4.Trigger execute implicitly whereas store procedure execute via procedure call from another block.

5.We can call a stored procedure from front end (.asp files, .aspx files, .ascx files etc.) but we can't call a trigger from these files.

6. Stored procedure can take the input parameters, but we can't pass the parameters as an input to a trigger.

>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Bharathi Cherukuri

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/18/2013 8:30:27 PM