473,586 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Difference B/W Triggers and Stored Procedurs?

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

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

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

If i m right,Stored procedures are similar to Functions in C??
Feb 26 '08 #1
2 1387
Delerna
1,134 Recognized Expert Top Contributor
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 Recognized Expert Specialist
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
14228
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 things from one while logged onto the other. I'm working on a project to keep the data in the two systems synchronized, so I'm using triggers on...
17
2188
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
2529
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 cumbersome. Are there better tools for creating and managing triggers? Mark Flippin
0
1756
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 program which catches the trigger buffer and drops it into a data structure, then the SQLRPG ILE program calls a SQL stored proc with the right parameter...
1
14352
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 is there any way to create stored procedures or triggers in Access. Also, I want to know that can we migrate data from any platform? i downloaded...
1
1210
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 handlers in the triggers themselves, but need to call a stored procedure. So... what is the purpose of being able to declare conditions in triggers...
5
1802
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 and triggers for my database using T-SQL,but i noticed bad performance (its kinda slow),so i ask:writing them in C# would i achieve a (considerable)...
4
5721
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
2237
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 <> OLD.DEPT)CALL COBOL_SP1 (NEW.DEPT,NEW.DEPT_NO) CREATE TRIGGER DB.TG2 AFTER INSERT ON Table1REFERENCING NEW AS NEW FOR EACH ROW MODE DB2SQL WHEN (...
0
7839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.