IF EXISTS( SELECT * FROM SYS.OBJECTS 
			WHERE NAME ='TRG_EST_PED_CP_IT_PENDENCIA_COMPRADOR_INCLUI_PENDENCIA'AND TYPE = 'TR')
BEGIN
	DROP TRIGGER dbo.TRG_EST_PED_CP_IT_PENDENCIA_COMPRADOR_INCLUI_PENDENCIA 
END
GO
CREATE TRIGGER [dbo].[TRG_EST_PED_CP_IT_PENDENCIA_COMPRADOR_INCLUI_PENDENCIA] ON [dbo].[EST_PED_CP_IT] FOR INSERT AS
INSERT INTO EST_PED_CP_IT_PENDENCIA_COMPRADOR (CD_EMP, CD_FILIAL, CD_PED, CD_PROD, DT_CAD)
	SELECT CD_EMP, CD_FILIAL, CD_PED, CD_PROD, GETDATE()
	FROM INSERTED c
	