C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






What is a Trigger?


Posted Date: 20 Jun 2008    Resource Type: Definitions    Category: General

Posted By: Bunty       Member Level: Diamond
Rating:     Points: 4



A trigger is a block of code that constitutes a set of T-SQL statements that are activated in response to certain actions or conditions.

A trigger can also be interpreted as a special kind of stored procedure that is executed whenever an action,such as data modification,takes place.

A Trigger is fired whenever data in the underlying table is affected by any of the Data Manipulation Language (DML) statements -INSERT,UPDATE,OR DELETE.

Triggers help in maintaining consistent,reliable,and correct data in tables.They enable the performance of complex actions and cascade these actions to other dependent tables.




Responses

Author: Sriram    05 Oct 2008Member Level: Gold   Points : 2
Trigger;

Trigger is an Self Contained block of Statements ,Trigger has fired when an DML Statements(Insert,update,delete) statements,
Sql Server 2005 supporting on DDL Statements also.

There are two types of Trigger is available
1) instead of Trigger
2) After Trigger

1) Instead Trigger : First checking the Condition after its fired.
2) After Trigger : First Fired then after Checking the Condition.

Thanks
SriramRamaswamy


Author: Mari raj k    08 Oct 2008Member Level: Silver   Points : 2
Types of Triggers
A trigger:
• Is a PL/SQL block or a PL/SQL procedure
associated with a table, view, schema, or the
database
• Executes implicitly whenever a particular event
takes place
• Can be either:
– Application trigger: Fires whenever an event occurs
with a particular application
– Database trigger: Fires whenever a data event (such
as DML) or system event (such as logon or
shutdown) occurs on a schema or database


Types of Triggers

Application triggers execute implicitly whenever a particular data manipulation language (DML) event occurs within an application. An example of an application that uses triggers extensively is one developed with Oracle Forms Developer.

Database triggers execute implicitly when a data event such as DML on a table (an INSERT, UPDATE,
or DELETE triggering statement), an INSTEAD OF trigger on a view, or data definition language (DDL) statements such as CREATE and ALTER are issued, no matter which user is connected or which application is used. Database triggers also execute implicitly when some user actions or database system actions occur, for example, when a user logs on, or the DBA shut downs the database.

Note: Database triggers can be defined on tables and on views. If a DML operation is issued on a view, the INSTEAD OF trigger defines what actions take place. If these actions include DML operations on tables, then any triggers on the base tables are fired.

Database triggers can be system triggers on a database or a schema. With a database, triggers fire for
each event for all users; with a schema, triggers fire for each event for that specific user.

Guidelines for Designing Triggers
• Design triggers to:
– Perform related actions
– Centralize global operations
• Do not design triggers:
– Where functionality is already built into the Oracle
server
– That duplicate other triggers
• Create stored procedures and invoke them in a
trigger, if the PL/SQL code is very lengthy.
• The excessive use of triggers can result in
complex interdependencies, which may be difficult
to maintain in large applications.




Author: Mari raj k    08 Oct 2008Member Level: Silver   Points : 2
Types of Triggers
A trigger:
• Is a PL/SQL block or a PL/SQL procedure
associated with a table, view, schema, or the
database
• Executes implicitly whenever a particular event
takes place
• Can be either:
– Application trigger: Fires whenever an event occurs
with a particular application
– Database trigger: Fires whenever a data event (such
as DML) or system event (such as logon or
shutdown) occurs on a schema or database


Types of Triggers

Application triggers execute implicitly whenever a particular data manipulation language (DML) event occurs within an application. An example of an application that uses triggers extensively is one developed with Oracle Forms Developer.

Database triggers execute implicitly when a data event such as DML on a table (an INSERT, UPDATE,
or DELETE triggering statement), an INSTEAD OF trigger on a view, or data definition language (DDL) statements such as CREATE and ALTER are issued, no matter which user is connected or which application is used. Database triggers also execute implicitly when some user actions or database system actions occur, for example, when a user logs on, or the DBA shut downs the database.

Note: Database triggers can be defined on tables and on views. If a DML operation is issued on a view, the INSTEAD OF trigger defines what actions take place. If these actions include DML operations on tables, then any triggers on the base tables are fired.

Database triggers can be system triggers on a database or a schema. With a database, triggers fire for
each event for all users; with a schema, triggers fire for each event for that specific user.

Guidelines for Designing Triggers
• Design triggers to:
– Perform related actions
– Centralize global operations
• Do not design triggers:
– Where functionality is already built into the Oracle
server
– That duplicate other triggers
• Create stored procedures and invoke them in a
trigger, if the PL/SQL code is very lengthy.
• The excessive use of triggers can result in
complex interdependencies, which may be difficult
to maintain in large applications.




Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Uses of triggers  .  Triggers deifinition  .  Triggers and itheir uses  .  Triggers  .  Dml commands and triggers  .  Definition of a trigger  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Cursors and it's Structure
Previous Resource: Value Type and Reference Type
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween masks

Contact Us    Privacy Policy    Terms Of Use