Join Martin Guidry for an in-depth discussion in this video Using nested triggers, part of SQL Server: Triggers Stored Procedures and Functions.
In our two previous examples we created one trigger that will block deletions…from the categories table, instead marking records as inactive, and we created…another trigger that when a category is marked as inactive, it marks all…products as inactive also.…This means that if I issue a DELETE statement, the first trigger fires, blocking…my DELETE statement, and instead updating the record.…That update, the update that was caused by the trigger, will in turn cause the…second trigger to fire.…
This situation where the actions of one trigger cause the next trigger to fire…is called nested triggers.…The ability to nest triggers is turned on by default, but you can turn it off if you want to.…I have some code in your exercise files that will do this.…It's an SP configure, the feature we would like to configure is nested triggers.…It is turned on by default which would be a 1.…So we'll use a 0 to turn it off and if you'd like to turn it back on, just use a 1.…
Even when nested triggers is turned on, it is always limited to 32 levels.…
- Comparing triggers, functions, and stored procedures
- Installing and configuring SQL Server
- Creating a stored procedure
- Returning data using data sets
- Creating user-defined functions
- Using "after," "instead," and nested triggers
- Modifying existing stored procedures
- Implementing logging on DELETE
- Choosing between T-SQL and CLR
- Executing a stored procedure
- Passing parameters
Skill Level Advanced
1. Getting Started
2. Installing SQL Server
Configuring your environment4m 53s
3. Stored Procedures
4. User-Defined Functions
6. Putting It All Together
7. Using CLR Assemblies
8. Exploring an ASP.NET Web Application
Next steps1m 43s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.