Day 19. Solving Special Trigger Problems

As you have learned on Day 18, "Writing and Testing Triggers," triggers give you the ability to have SQL code execute automatically whenever an action, INSERT, UPDATE, or DELETE is taken against a table. Now that you know how to create triggers and where you should use them, you will see how they can assist you in solving some special requirements in an application.

When designing and creating a complex application that uses T-SQL to access data in a relational database, there will be times when you will want to ensure that certain business rules are enforced. There will also be a need for a particular update to be made throughout multiple tables. By using triggers, you can accomplish these goals. Some ...

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.