CREATE TRIGGER [dbo].[Del_Purview] ON [dbo].[BG_Group] AFTER DELETE AS IF @@ROWCOUNT = 0 RETURN DELETE FROM BG_Purview WHERE GroupID IN (SELECT GroupID FROM deleted)