CREATE TRIGGER PersonsDeleteDependents >>> ON Persons >>> FOR DELETE >>>AS >>>BEGIN >>> -- SET NOCOUNT ON added to prevent extra result sets from >>> -- interfering with SELECT statements. >>> SET NOCOUNT ON; >>> >>> -- Insert statements for trigger here >>> delete Persons >>> from Persons >>> inner join deleted on deleted.personid = persons.parentid >>> >>>END>>>
Parent Child1 Child2 Grand Child1 Grand Child2 Grand Grand Child1and you delete Parent?