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

CREATE TRIGGER [dbo].[TRG_EST_NFE_MAN_PED_TRANSF_CRED_IBS_VALIDADA] ON [dbo].[EST_NFE_MAN_PED_TRANSF_CRED_IBS_VALIDADA] FOR INSERT AS

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