Managing Special Database Actions with Triggers

In addition to using triggers to help you enforce the business rules within your database, you can also use them to perform tasks that would be too complicated without them. In this next section, you will learn about three different tasks that you might need to use in any application you create. The first two are important if you will be tracking any type of summary or derived values within the database itself. The second task is more of an administrative task, but creating an audit trail is important if you need to know where, when, and maybe who performed each action against the database. Some of the database actions will use the ability to cascade or nest one or more triggers. This enables you ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.