473,395 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1379
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

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

Similar topics

4
by: Hank | last post by:
I have two SQL Server 2000 machines (server_A and server_B). I've used sp_addlinkedserver to link them both, the link seems to behave fine. I can execute remote queries and do all types of neat...
17
by: serge | last post by:
How can i delete all user stored procedures and all table triggers very fast in a single database? Thank you
4
by: Mark Flippin | last post by:
I'm just starting to use triggers in my databases and find the support in Enterpise Manager lacking. Using Enterprise Manager and Query Analyzer you can maintain the triggers, but it's...
0
by: Dave Sisk | last post by:
Hi Folks: I've got this scenario: User table/file....external triggers declared for *AFTER *INSERT, *AFTER *UPDATE, and *BEFORE *DELETE. The 3 external triggers call a SQLRPG ILE stub...
1
by: Manish Bafna | last post by:
speaking of me, I'm not very new to Access, but I haven't worked on it as a professional. I know that you can fire queries in Access, but I don't think you can create views. i want to know that...
1
by: cleaner7777 | last post by:
Just wondering... When creating triggers, you're allowed to create conditions with the: DECLARE condition-name CONDITION FOR SQLSTATE string-constatnt However, you are not allowed to create...
5
by: FP | last post by:
Hi, i have read that with Visual Studio 2005 it's possible to create stored procedures and triggers for a Sql Server 2005 database. I must admit that i have already written the stored procedures...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
2
by: ajaysbedi | last post by:
Hi, I have 2 triggers on a table, both triggers are updating the another table create trigger DB.TRG1 AFTER INSERT ON Table1REFERENCING NEW AS NEW FOR EACH ROW MODE DB2SQL WHEN ( NEW.DEPT <>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.