INSTEAD OF DELETE
INSTEAD OF DELETE triggers can be defined on a view or table to replace the standard action of the DELETE statement. Usually, the INSTEAD OF DELETE trigger is defined on a view to modify data in one or more base tables.
DELETE statements do not specify modifications to existing data values. DELETE statements specify only the rows that are to be deleted. The inserted table passed to a DELETE trigger is always empty. The deleted table sent to a DELETE trigger contains an image of the rows as they existed before the DELETE statement was issued. In the case of an INSTEAD OF DELETE trigger on a view or table, the format of the deleted table is based on the format of the select list defined for the view.
USE [SampleDB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [dbo].[trg_ShippingImport_Delete] ON [dbo].[ShippingImport] INSTEAD OF DELETE AS BEGIN SET NOCOUNT ON; delete from Import where OrderID in (select OrderID from deleted) END