Learn "after" Triggers in SQL Server 2012


show more Using "after" triggers provides you with in-depth training on Business. Taught by Martin Guidry as part of the SQL Server: Triggers, Stored Procedures, and Functions show less
please wait ...

Using "after" triggers

In this chapter, I'll be working with two new tables; a products table and a categories table. I've created a script that will generate those tables and populate them with some data. There in your exercise files. You can copy and paste all of that into Management Studio and run it. And it should've given me two new tables. And let's double check and make sure we have some data in those tables. Oh, that looks good. The first type of trigger I'd like to talk about is called an 'after' trigger.

It's called this because it executes immediately after an insert, update or DELETE statement. The trigger allows the original statement to occur with no modifications. Then it immediately takes over and starts doing some work. In this example, we're going to use the trigger to enforce a business rule. The business rule states that whenever a category is marked as inactive, all of the products in that category should immediately be marked as inactive also. So I have s...

Using "after" triggers
Video duration: 3m 47s 1h 52m Advanced

Viewers:

Using "after" triggers provides you with in-depth training on Business. Taught by Martin Guidry as part of the SQL Server: Triggers, Stored Procedures, and Functions

Subjects:
Business Developer IT
Software:
SQL Server
Author:
please wait ...