Chapter IV.3. Triggers

Triggers are powerful tools that you can use to automate control of your server and databases. Three categories of triggers are available in SQL Server 2008: Data Manipulation Language (DML) triggers, Data Definition Language (DDL) triggers, and logon triggers.

To control data modifications within your database, you use a DML trigger. To control modifications of objects (such as databases or tables), you use a DDL trigger. To audit or control logins, you create a logon trigger.

The great thing about a trigger is that you create it once, and it manages your server or database forever more. You could be vacationing in Hawaii or the Swiss Alps, and the trigger will still do your bidding.

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® 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.