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

CREATE TRIGGER [dbo].[TRG_EST_NFE_SOLIC_APROP_CRED_BENS_SERVS_VALIDADA] ON [dbo].[EST_NFE_SOLIC_APROP_CRED_BENS_SERVS_VALIDADA] FOR INSERT AS

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