Hidden Tables in SQL Server


When we insert the record into the table, the magic table "INSERTED" will be created In that table the current inserted row will be available. We can access this record in the "TRIGGER".

When we delete the record from the table, the magic table "DELETED" will be created In that table the current deleted row will be available. We can access this record in the "TRIGGER".

When we update the record from the table, the INSERTED table contains new values and DELETED table contains the old values

Syntax of the Trigger

CREATE TRIGGER TriggernName ON TableName
INSERT,DELETE, UPDATE
AS  
Body of the Trigger