Updated on Kisan Patel
This example will show you how to create AFTER UPDATE
triggers in SQL Server?
CREATE TRIGGER UPDATETrigger ON [NORTHWND].[dbo].[Region] AFTER UPDATE AS BEGIN DECLARE @id int SELECT @id = [RegionID] FROM inserted INSERT INTO [Region] (RegionDescription) VALUES ('New') END
In the above query, we are creating a UPDATETrigger
trigger that will execute only when Region record will get updated.
To trigger the above trigger, we need to fire an UPDATE statement on [NORTHWND].[dbo].[Region]
table.