SQL Server Triggers

This is a list of articles about SQL Server Triggers that have been published on this website. This is intended to be a quick reference.

 

Triggers in SQL Server

A trigger is a sort of stored procedure that is triggered when an event happens in the database server. There are 3 types of triggers as described below: DML Triggers: DML triggers are triggered when a user attempts to edit data using a data manipulation language (DML) event. These triggers are triggered anytime any eligible…

SQL Server Triggers – Enable and Disable

In this article, you’ll know how to enable and disable triggers in SQL Server. Syntax and Example: DISABLE TRIGGER trgEmpInsDelUpd ON Emp; GO ENABLE TRIGGER trgEmpInsDelUpd ON Emp; GO A disabled trigger is still present in the current database as an object, but it does not fire. Enabling a trigger does not result in its…

SQL Server Triggers – After Insert, Update, and Delete – An example

When a DML statement is issued against a table, a DML trigger is fired. It can execute before or after the DML procedure depending on the condition. In this article, you’ll know how to write a trigger that writes an entry into an audit table, whenever a row is inserted or updated, or deleted on…

Leave a Reply