Problems with Triggers

Triggers, a type of stored procedure (as discussed in Chapter 15, "Writing Triggers,"), can run into the same problems we have already discussed. Triggers are very complex and can be used to add a great deal of functionality to any application that you write. This functionality can come with some performance issues as well. The main piece of advice I can give you is that you need to make your triggers as lean as possible so that they execute quickly. Don't try to pack too much functionality into the trigger. If you can, move some of the functionality out of the trigger and into the application that performs the data modification that executes the trigger. You need to keep in mind the following things when writing triggers: ...

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.