faqts : Computers : Databases : Microsoft SQL Server

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

37 of 68 people (54%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

Database: SQL: Trigger: What is a trigger? [stored procedure]

Dec 24th, 2003 10:57
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 23 December 2003 - 00:20 am -------------------
Database: SQL: Trigger: What is a trigger? [stored procedure]
---
A trigger is a special kind of stored procedure which executes when
a database is changed for some reason.
---
A trigger is connected with some table, and as such its SQL content
will be executed when e.g. a row is inserted, updated, or deleted.
---
For example:
---
If you decide to change an amount (e.g. a salary) in a database table,
after that, your trigger (=stored procedure containing your SQL
statements) is automatically executed, causing e.g. automatically some
other tables (like expenses) to be updated accordingly.
---
---
Book: see also:
---
[book: author: Holzner, Steve / Howell, Bob - title: ADO.NET 
Programming in Visual Basic .NET - publisher: Prentice Hall - year: 
2002 - ISBN 0-13-101881-7]
---
[book: author: Groff, James R. / Weinberg, Paul N. - title: SQL (the 
complete reference) - publisher: McGraw-Hill - year: 1999 - ISBN 0-07-
211845-8 - p. 716 'Triggers']
----------------------------------------------------------------------