IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_EST_NFE_FORN_NAO_REALIZ_COM_PGTO_ANTECIP_EST_NF_ENT]'))
begin
	ALTER TABLE EST_NFE_FORN_NAO_REALIZ_COM_PGTO_ANTECIP_EST_NF_ENT ADD CONSTRAINT FK_EST_NFE_FORN_NAO_REALIZ_COM_PGTO_ANTECIP_EST_NF_ENT
	FOREIGN KEY (CD_EMP, CD_FILIAL, CD_NF) REFERENCES EST_NF_ENT (CD_EMP, CD_FILIAL, CD_NF);
end