Overview
In this section, we will discuss the different types of triggers depending on the type of event that fires the trigger.
Explanation
SQL Server has three types of triggers:
- DML (Data Manipulation Language) Triggers
- DDL (Data Definition Language) Triggers
- Logon Triggers
DML Triggers allow us to execute code in response to data modification. In other words, they allow us to run additional code in response to the execution of an insert, update, or delete statement.
DDL Triggers give us the possibility to execute code in response to changes in the structure of a database, like dropping or creating a table, or a server event, like when someone logs in. DDL Triggers can be split into two different types based on scope:
- Database Scoped DDL Triggers
- Server Scoped DDL Triggers
Logon Triggers are a particular case of Server Scoped DDL triggers that fire in response to the LOGON event that’s raised when a user’s session is being established.
Additional Information

Daniel Farina was born in Buenos Aires, Argentina. Self-educated, since childhood he showed a passion for learning. He studied at Universidad de Buenos Aires. Daniel started working as a programmer at a young age. Over the years he specialized in databases, particularly SQL Server and Oracle. Now with 30 years of age, his work experience includes working with various technologies like VB, C, .NET, web development, Windows and Linux systems. He likes to read about science, psychology, philosophy and many other things. In his spare time, he trains powerlifting aiming to compete.
- MSSQLTips Awards: Author of the Year – 2018 | Champion (100+ tips) – 2018 | Author Contender – 2015-2017, 2019
