IF EXISTS (SELECT * FROM SYS.TRIGGERS WHERE NAME = 'TRG_EST_PROD_CPL_DEMANDA_PROC_CPL_INCLUI_PENDENCIA')
begin
	DROP TRIGGER [dbo].[TRG_EST_PROD_CPL_DEMANDA_PROC_CPL_INCLUI_PENDENCIA]
end
go
CREATE TRIGGER [dbo].[TRG_EST_PROD_CPL_DEMANDA_PROC_CPL_INCLUI_PENDENCIA] ON [dbo].[EST_PROD_CPL_DEMANDA_PROC_CPL] FOR INSERT AS
INSERT INTO EST_PROD_CPL_DEMANDA_PROC_CPL_PENDENTE_APLICAR_MEDIAF (
		CD_CTR_PROC_CPL,
		DT_CAD)
	SELECT 
		CD_CTR,
		GETDATE()
    FROM 
		INSERTED p;