SQL Server Database Triggers

SQL Server Database Triggers

English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 1h 39m | 220 MB

SQL Server database triggers help database developers automate routine tasks. Triggers wait for an activating event to occur, then immediately respond with preprogrammed operations. This course, from database expert Adam Wilbert, takes a deep dive into leveraging these powerful and flexible components of a SQL Server database. Follow along and learn how to create and deploy different types of triggers, and get hands-on experience using triggers to solve common problems, such as timestamping data changes or collecting information about table events. Adam also helps you manage your database triggers: enabling, disabling, and reordering triggers as necessary. Plus, follow along with a hands-on project in chapter six, which uses triggers to perform tasks automatically in an inventory management system, such as updating inventory when new product is received.

Topics include:

  • Trigger types
  • Creating triggers
  • Firing triggers
  • Working with modified data
  • Creating database- and server-level triggers
  • Enabling and disabling triggers
  • Reordering trigger execution
Table of Contents

1 Automate SQL Server with triggers
2 What you should know
3 Make the most of the exercise files
4 What are SQL Server triggers-
5 Two triggers types- INSTEAD OF and AFTER
6 Create a trigger to print a message
7 Timestamp a table modification
8 Firing INSTEAD OF triggers
9 Challenge- Create a trigger
10 Solution- Create a trigger
11 Read values modified by a trigger
12 Using the inserted logical table
13 Using the deleted logical table
14 Triggers on CREATE, ALTER, or DROP
15 Rollback database modifications
16 Reading the EVENTDATA() XML
17 Writing data from the EVENTDATA() function
18 Challenge- Create a DDL trigger
19 Solution- Create a DDL trigger
20 View all triggers in a database
21 Enable and disable triggers
22 Disable nested triggers
23 Recursive triggers
24 Reorder trigger execution
25 Creating triggers to maintain inventory
26 Counting shipments received
27 Subtract items sold
28 Reorder items when low
29 Next steps