IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_PG_CRED_ALT_AUDIT_PG_CRED]'))
begin
	ALTER TABLE [dbo].[PG_CRED_ALT_AUDIT] DROP CONSTRAINT [FK_PG_CRED_ALT_AUDIT_PG_CRED]
end
GO
GO
ALTER TABLE dbo.PG_CRED_ALT_AUDIT ADD CONSTRAINT
	FK_PG_CRED_ALT_AUDIT_PG_CRED FOREIGN KEY
	(
	CD_EMP,
	CD_FILIAL,
	CD_PG_CRED
	) REFERENCES dbo.PG_CRED
	(
	CD_EMP,
	CD_FILIAL,
	CD_PG_CRED
	) ON UPDATE  CASCADE 
	 ON DELETE  CASCADE 
	