472,090 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,090 software developers and data experts.

Difference B/W Triggers and Stored Procedurs?

Hey can anyone tell me whether Triggers and Stored Procedures are same?

Triggers are stored procedures that get executed automatically when an Insert,Update,or Delete operation takes place.

Stored Procedures
.------????

If i m right,Stored procedures are similar to Functions in C??
Feb 26 '08 #1
2 1326
Delerna
1,134 Expert 1GB
you are correct.

I would add to stored procedures
that they execute on the server and they can, but don't have to, return a recordset like a view does.

other than that yes they are like functions and subs in programming languages such as c, vb, java etc.
Feb 26 '08 #2
ck9663
2,878 Expert 2GB
The only other difference is you can not embed a stored proc call in a statement, not like function

Correct:

If MyFunction() = 1

But Not:

If MyStoredProc = 1

-- CK
Feb 27 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Mark Flippin | last post: by
4 posts views Thread by --CELKO-- | last post: by
2 posts views Thread by ajaysbedi | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.