SQL Triggers – An Introduction

SQL Triggers – An Introduction Contents Introduction Magic Tables Difference between Stored Procedure and Trigger DML Triggers After Triggers Syntax of the After trigger Example of After Trigger for Insert Example of After Trigger for Delete Example of After Trigger for Update Instead of Triggers DDL Triggers DDL Trigger for Create Table DDL Trigger for […]

Continue Reading

Advantages & Disadvantages of SQL Trigger

Advantages & Disadvantages of SQL Trigger Introduction Triggers are database objects which are needed to perform some predefined action for automatic execution whenever users try to do execute data modification commands (INSERT, DELETE and UPDATE) on the specified tables. Triggers are helpful since it can help in maintaining the integrity of the data in database tables […]

Continue Reading

SQL Script to find all the triggers defined on a database or on a single table

SQL Script to find triggers in SQL Database Sometime we need to find all the triggers defined on the database. So in this case, we can use the below SQL Query:-SELECT tbl.name as [Table Name] , trig.name as [Trigger Name] , trig.is_disabled FROM [sys].[triggers] as trig INNER JOIN sys.tables as tbl ON trig.parent_id = tbl.object_idIn […]

Continue Reading