IF  EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[TRG_EST_NFE_INF_EFET_PGTO_INTEG_VALIDADA]'))
	DROP TRIGGER [dbo].[TRG_EST_NFE_INF_EFET_PGTO_INTEG_VALIDADA]
GO

CREATE TRIGGER [dbo].[TRG_EST_NFE_INF_EFET_PGTO_INTEG_VALIDADA] ON [dbo].[EST_NFE_INF_EFET_PGTO_INTEG_VALIDADA] FOR INSERT AS

--Excluindo pendencia de valida da carta de correcao.
DELETE 
	pend 
FROM 
	INSERTED I inner join EST_NFE_INF_EFET_PGTO_INTEG_PEND pend ON
    I.CD_CTR_INF_EFET_PGTO_INTEG = pend.CD_CTR_INF_EFET_PGTO_INTEG