IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_PDV_VD_IT_FISCAL_ALTERACAO_PDV_VD_IT]'))
begin
	ALTER TABLE [dbo].[PDV_VD_IT_FISCAL_ALTERACAO] DROP CONSTRAINT [FK_PDV_VD_IT_FISCAL_ALTERACAO_PDV_VD_IT]
end
ALTER TABLE dbo.PDV_VD_IT_FISCAL_ALTERACAO ADD CONSTRAINT
	FK_PDV_VD_IT_FISCAL_ALTERACAO_PDV_VD_IT FOREIGN KEY
	(
	CD_EMP,
	CD_FILIAL,
	CD_VD,
	CD_IT
	) REFERENCES dbo.PDV_VD_IT
	(
	CD_EMP,
	CD_FILIAL,
	CD_VD,
	CD_IT
	) ON UPDATE  CASCADE 
	 ON DELETE  CASCADE 
	