IF NOT OBJECT_ID('TRG_EST_NF_ENT_DAR_PEND_DELETE') IS NULL
	BEGIN 
		DROP TRIGGER TRG_EST_NF_ENT_DAR_PEND_DELETE 
	END  
GO 
CREATE TRIGGER TRG_EST_NF_ENT_DAR_PEND_DELETE ON EST_NF_ENT_DAR FOR INSERT
AS
	BEGIN	
	
		DELETE P
		FROM 
			EST_NF_ENT_DAR_PEND P
			INNER JOIN INSERTED I ON 
				P.CD_EMP = I.CD_EMP
				AND P.CD_FILIAL = I.CD_FILIAL 
				AND P.CD_NF = I.CD_NF
				
		
	END