Differences between the stored procedures and triggers

No.of Views581
Bookmarked0 times
Downloads 
Votes1
By  skumaar_mca   On  16 Feb 2010 03:02:03
Tag : Sql Servers , T-SQL
Differences between the stored procedures and triggers
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

 

  • The stored procedures used for performing task

The stored procedures normally used to performing user specified tasks. It can have the parameters. It can return multiple results set.

 

  • The Triggers for auditing work

The triggers normally used for auditing work. It can be used to trace the activities of the table events.

 

  • The stored procedures can have the parameters.

The procedures can have the input and output parameters with all the data types available in the sql server as well as user defined data types.

 

  • The Triggers cannot have any parameters

The triggers cannot have any parameters.

 

  • The stored procedure can be run independently

The stored procedures can be run independently .It stores as a database object. It can be called from the application.

 

  • The triggers executes based on table events

The DML triggers are get executed based on the table events defined on the particular table. There are different types of triggers like DML triggers, DDL triggers (from 2005 onwards) and logon triggers (from 2008 onwards).

The DDL triggers can control the stored procedures creation, drop, ect.,

 

  • The stored procedure cannot call triggers

The stored procedures cannot call the triggers directly. But when we do the DML operations on the table, if the corresponding table has the trigger then that time it will get trigger.

 

  • The triggers can call stored procedures

The triggers can call the stored procedures.


 
Sign Up to vote for this article
 
About Author
 
skumaar_mca
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Not Provided
Joined date-11 Sep 2009
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top