IF NOT OBJECT_ID('TRG_EST_PROD_TRILHO_EXCESSO_PENDENTE') IS NULL
begin
	DROP TRIGGER TRG_EST_PROD_TRILHO_EXCESSO_PENDENTE
END
GO
CREATE TRIGGER [dbo].[TRG_EST_PROD_TRILHO_EXCESSO_PENDENTE] ON [dbo].[EST_PROD_TRILHO_EXCESSO_PENDENTE] FOR DELETE AS  
	
INSERT INTO EST_PROD_TRILHO_EXCESSO_PENDENTE_AUDIT (CD_EMP,		CD_FILIAL,		CD_CTR, DT_CAD)
SELECT 
	CD_EMP,
	CD_FILIAL,
	CD_CTR,
	GETDATE()
FROM   
	DELETED D