Trigger if updating inserting

It is a well-known fact that triggers can be detrimental to performance of a SQL Server database and should be used sparingly.

If a trigger is truly necessary then making it as efficient as possible is imperative.

By commenting, you are accepting the DISQUS terms of service.

trigger if updating inserting-75trigger if updating inserting-4trigger if updating inserting-76

Trigger names exist in the schema namespace, meaning that all triggers must have unique names within a schema.One way to be efficient is to skip sections of the trigger code if that code only needs to run when certain columns have been affected.It might also make sense to quickly exit the trigger using the RETURN command in the same situation.Triggers can be set to run as a part of any combination of INSERT, UPDATE, and DELETE statements.Often the actions undertaken by the trigger only need to happen in certain scenarios where specific columns have been affected.

Leave a Reply