I need to insert the deleted rows from table Table_A to Table_B which have the same structure
(something like recycle bin) but i don’t have much experience in SQL SERVER Triggers
CREATE TRIGGER dbo.Table_A_Delete_Instead_Of_Trigger
ON dbo.Table_A
INSTEAD OF DELETE
AS
BEGIN
INSERT INTO Table_B
SELECT T
DELETE T
END
please spare my lake of experience. Thanks.
You don’t need an ‘INSTEAD OF’ trigger, you need an ‘AFTER’ trigger.
Given a table TableA…
and a corresponding TableB…
Then the following trigger will do what you wish: