xxxxxxxxxx
CREATE TRIGGER tr_audit_delete
ON dbo.customers
AFTER DELETE
AS
BEGIN
SELECT * FROM DELETED;
END
/*
If you issue a DELETE statement that deletes three rows from the customers
table, the trigger will execute and the SELECT statement will return those
three rows. If you issue a DELETE statement that deletes no rows from the
customers table, the trigger will still execute, but the SELECT statement
will return no rows.
It's important to note that the DELETED table is a temporary, in-memory table
that is only available within the context of the trigger. It is not a real
database table, and it is not persisted to disk. The DELETED table is
automatically created and populated when a trigger is executed, and it is
automatically dropped when the trigger completes.
*/