IF EXISTS( SELECT * FROM SYS.OBJECTS 
			WHERE NAME ='TRG_PG_CRED_PROC_PENDENCIA_INCLUI_PENDENCIA'AND TYPE = 'TR')
BEGIN
	DROP TRIGGER dbo.TRG_PG_CRED_PROC_PENDENCIA_INCLUI_PENDENCIA 
END
GO
CREATE TRIGGER [dbo].[TRG_PG_CRED_PROC_PENDENCIA_INCLUI_PENDENCIA] ON [dbo].[PG_CRED] FOR INSERT,UPDATE AS
INSERT INTO PG_CRED_PROC_PENDENCIA (CD_EMP, CD_FILIAL, CD_PG_CRED, DT_CAD,STS_DP)
	SELECT CD_EMP, CD_FILIAL, CD_PG_CRED, GETDATE(),STS_DP
	FROM INSERTED c
	