Problems with Triggers

The main two problems that you will encounter when using triggers are performance and concurrency issues. Chapter 16, "Considerations When Using Stored Procedures and Triggers," provides the steps you can take to alleviate these problems.

Although small, fast-executing triggers don't usually result in problems, large and complex triggers can result in performance problems. All triggers, nested or otherwise, execute serially. This action can result in overall transaction length issues that can cause problems in the client layer.

For example, I once worked on a system that had a trigger on the most active table in the database that, when printed, was 27 pages long. Not only that, but the trigger affected other tables in the ...

Get Writing Stored Procedures for Microsoft SQL Server 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.