Chapter 7: Triggers


Overview

As we approach the conclusion of this book, we come to an important topic in the specialized stored procedure arena – triggers. Triggers are best used for enforcing business rules as well as performing validation or data modifications, when other methods are not sufficient.

We will see that triggers are mainly used in two areas:

  • Creating audit records and reflecting changes to crucial business tables

  • Validating of changes against a set of business rules coded in T-SQL

In this chapter, we will cover:

  • What a trigger is and why it exists

  • Performance considerations

  • How to create a trigger and its different types

  • Transactions and rollbacks within triggers

  • Recursive triggers

  • Good and bad programming practices




SQL Server 2000 Stored Procedures Handbook
SQL Server 2000 Stored Procedures Handbook (Experts Voice)
ISBN: 1590592875
EAN: 2147483647
Year: 2005
Pages: 100

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net