IF NOT OBJECT_ID ('FK_EST_NF_SAI_IT_EST_NF_SAI_IT_EST_SNGPC_SAIDA') IS NULL
	BEGIN
		ALTER TABLE dbo.EST_NF_SAI_IT_EST_SNGPC_SAIDA
			DROP CONSTRAINT FK_EST_NF_SAI_IT_EST_NF_SAI_IT_EST_SNGPC_SAIDA
	END

GO



ALTER TABLE [dbo].[EST_NF_SAI_IT_EST_SNGPC_SAIDA]
ADD CONSTRAINT [FK_EST_NF_SAI_IT_EST_NF_SAI_IT_EST_SNGPC_SAIDA] FOREIGN KEY ([CD_EMP], [CD_FILIAL], [CD_NF], [CD_PROD], [CD_IT]) 
  REFERENCES [dbo].[EST_NF_SAI_IT] ([CD_EMP], [CD_FILIAL], [CD_NF], [CD_PROD], [CD_IT]) 
  ON UPDATE CASCADE
  ON DELETE CASCADE

GO
	