What is Trigger in SQL

What is Trigger in SQL

Why we use the Trigger and what it's uses?

View Answers

March 15, 2012 at 4:37 PM

A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database. Triggers can restrict access to specific data, perform logging, or audit data modifications. Triggers supplement the standard capabilities of your database to provide a highly customized database management system. For example, you can use triggers to:

1)Automatically generate derived column values.

2)Enforce referential integrity across nodes in a distributed database

3)Enforce complex business rules

4)Provide transparent event logging

5)Provide auditing

6)Maintain synchronous table replicates

7)Gather statistics on table access

8)Modify table data when DML statements are issued against views

9)Publish information about database events, user events, and SQL statements to subscribing applications

10)Restrict DML operations against a table to those issued during regular business hours

11)Enforce security authorizations

12)Prevent invalid transactions









Related Tutorials/Questions & Answers:
What is Trigger?
What is Trigger?  What is Trigger
What is Trigger?
What is Trigger?  What is Trigger?   Hi, A trigger... and DELETE. The difference between a trigger and a stored procedure is that a trigger is activated or called when an event happens in a database table, a stored
Advertisements
using trigger - SQL
-update-trigger.shtml http://www.roseindia.net/sql/trigger/mysql-trigger-after...using trigger  sir i want to use this trigger in ado.net. how it is possible ? Create trigger tr1 on student after update as begin update m
Create Delete Trigger in SQL
Create Delete Trigger in SQL       Create Delete Trigger in SQL fire this trigger before... Trigger in SQL'. To understand this example, we create a table 'Stu_Table
Create After Update Trigger in SQL
Create After Update Trigger in SQL       After Trigger in SQL is fired before update... The Tutorial illustrate an example from 'Create After Update Trigger in SQL
How to trap Trigger Error - SQL
How to trap Trigger Error  Hi Guys, Can you please help with my problem?.. Is there a way in where I can trap all SQL error and place it under... NVARCHAR(2000) ) select * froM ERROR_LOG CREATE OR REPLACE TRIGGER
Create Before Insert Trigger in SQL
Create Before Insert Trigger in SQL       The Create Before Insert Trigger in SQL fires the trigger..._TO_REPLACE_1 The given Tutorial describe you a code on 'Create Before Insert Trigger
Create After Insert Trigger in SQL
Create After Insert Trigger in SQL       Create a Trigger is a special kind of stored procedure... illustrate a example from 'Create After Insert Trigger in SQL'. In this Example
Create Before Update Trigger in SQL
Create Before Update Trigger in SQL       Create Before Update Trigger in SQL is used in SQL... 'Create Before Update Trigger in SQL' . To understand this example we
Create Before Update Trigger in SQL
Create Before Update Trigger in SQL       Create Before Update Trigger in SQL is used in SQL, if a trigger monitoring for changes to a column of the table
Create Before Insert Trigger in SQL
Create Before Insert Trigger in SQL       The Create Before Insert Trigger in SQL fires... Trigger in SQL'. To grasp this example, we create a table 'Stu_Table
Create After Update Trigger in SQL
Create After Update Trigger in SQL       After Trigger in SQL is fired before update... The Tutorial illustrate an example from 'Create After Update Trigger in SQL
Create Delete Trigger in SQL
Create Delete Trigger in SQL       Create Delete Trigger in SQL fire this trigger before... Trigger in SQL'. To understand this example, we create a table 'Stu_Table
What is the use of DESC in SQL?
What is the use of DESC in SQL?  What is the use of DESC in SQL
What's an SQL injection?
What's an SQL injection?  What's an SQL injection
trigger
trigger  write a trigger to see every manager must be highest salary
trigger
trigger  write a trigger program before insert into salary that it must not below Rs 1000
trigger
trigger  write a trigger program before insert into salary that it must not below Rs 1000
What are the prerequisites for learning SQL?
What are the prerequisites for learning SQL?  Hi, I want to learn... with the SQL using MySQL database. What are the things anyone should know before starting with the MySQL? What are the prerequisites for learning SQL? Which
MySQL After Trigger
MySQL After Trigger This example illustrates how to create the trigger and what is the use it. In this example we create a table "Roseindia"...' and 'description'. A trigger is defined to activate when an INSERT, DELETE, or UPDATE
What is meant by embedded SQL?
What is meant by embedded SQL?  What is meant by embedded SQL?   Hi, Embedded SQL statements are embedded with in application program and are prepared during the program preparation process before the program
What is the Delete Statements in SQL?
What is the Delete Statements in SQL?  What is the Delete Statements in SQL?   Hi, Here is the answer,ADS_TO_REPLACE_1 Delete statement in SQL is used to delete partial/all data. Especially delete statement is useful
What is the use of Hibernate Native SQL?
What is the use of Hibernate Native SQL?  What is the use of Hibernate Native SQL? How it is useful in database access programming using the Hibernate framework? Thanks   Hibernate Native query is used used to run SQL
What are pre requisites to learn SQL?
What are pre requisites to learn SQL?  Hi Guys, Where to learn SQL...... But I have decided to learn database using the MySQL database server. What are pre requisites to learn SQL? I want to know what should I learn before
Create After Insert Trigger in SQL
Create After Insert Trigger in SQL       Create a Trigger is a special kind of stored... illustrate a example from 'Create After Insert Trigger in SQL
Trigger
Trigger       Mysql Trigger After Delete The Tutorial illustrate an example from 'Trigger After Delete' in Mysql. To understand
What?s the maximum size of a row in SQL table?
What?s the maximum size of a row in SQL table?  What?s the maximum size of a row in SQL table?   Hi, The maximum Row Size is 8060 Bytes in a sql table.ADS_TO_REPLACE_1 Thanks
What is the difference between static and dynamic SQL?
What is the difference between static and dynamic SQL?  What is the difference between static and dynamic SQL?   Hi, Static SQL is SQL... be hard-coded into the application.Static SQL is usually targeted at a specific
What is the difference between UNION and UNION ALL in SQL?
What is the difference between UNION and UNION ALL in SQL?  What is the difference between UNION and UNION ALL in SQL?   Hi, UNION is an SQL keyword used to merge the results of two or more tables using a Select
What should I learn first SQL or Java?
What should I learn first SQL or Java?  Hi, I am total beginner... in programming particularly Java. What should I learn first SQL or Java? Thanks  ... and after that you can learn SQL. Learning Java first is important its the base
why we use ^ operator in sql, and what is the meaning of that operator?
why we use ^ operator in sql, and what is the meaning of that operator?  why we use ^ operator in sql, and what is the meaning of that operator
What is the main advantage of using the hibernate than using the SQL
What is the main advantage of using the hibernate than using the SQL  Hi, What is the main advantage of using the hibernate than using the SQL. thanks
What is the use of MySQL, MS SQL in Web Hosting paradigm?
What is the use of MySQL, MS SQL in Web Hosting paradigm?  I am.... For now I want to learn the things about MySQL, MS SQL in Web hosting. What... What is MySQL, MS SQL in Web Hosting. Thanks
SQL
SQL Trigger query  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed..., user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
What is Trigger in SQL  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed... events, user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
use of Trigger in SQL  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed..., user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
Trigger in SQL  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed... events, and SQL statements to subscribing applications 10)Restrict DML
trigger
PHP Trigger Error
PHP Trigger Error PHP trigger_error generates an error, warning, notice message. Basic format of the trigger_error is as follows: boolean trigger_error... angular bracket ) This method is used to trigger an user level error message
what is proper way to save pictures in SQl database and call it through JSP ?
what is proper way to save pictures in SQl database and call it through JSP ?  Hi guys, I usually store picture path in DB and call them through 'getContextPath()' mehtod using this method I can call pictures and Text on same
ModuleNotFoundError: No module named 'trigger'
ModuleNotFoundError: No module named 'trigger'  Hi, My Python... 'trigger' How to remove the ModuleNotFoundError: No module named 'trigger... to install padas library. You can install trigger python with following command
Stored Procedure and Trigger
Stored Procedure and Trigger  hello, What is the difference between Stored Procedure and Trigger ?   hii,ADS_TO_REPLACE_1 Triggers once defined are called automatically, there can be no explicit invocation Stored
sql
difference between sql and oracle  what is the difference between sql and oracle
throw exception in mysql trigger
throw exception in mysql trigger  throw exception in mysql trigger
Version of com.bartoszlipinski>trigger dependency
List of Version of com.bartoszlipinski>trigger dependency
SQL
SQL  1)What is ref cursor? Where u can use this ref cursor? 2)What is difference between procedure and function? 3)What is trigger? How many types of triggers are there? 4)What is cursor? Explain different types of Cursors
trigger after insert for deletion
trigger after insert for deletion   String query2 = "create TRIGGER trig after insert on "cart" + " FOR EACH ROW... = st1.executeUpdate( query2); i have to do the above trigger operation, but i'm stuck
Sql Server - SQL
sql server trigger example  Can any one tell me the live example of triggers in SQL Server?   if u click pistal trigger ,it auotmatically shoot bullet it's like newtons 3rd law (every action s having an equal reaction
example of before insert trigger in mysql
example of before insert trigger in mysql  Hi, How to create a simple before insert trigger in MySQL? Thanks   Hi, The before insert trigger is executed before saving the data into database. Trigger is stored
SQL
SQL  hii What is sql?   hello,ADS_TO_REPLACE_1 SQL, which stands for Structured Query Language, is a special-purpose language used to define, access, and manipulate data. SQL is non procedural, meaning

Ads