IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='EST_NF_ENT_DANFE_PROVISORIO_ITENS_ERRO_EAN') 
BEGIN

	CREATE TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_ERRO_EAN](
		[CD_CTR] [int] NOT NULL,
		[CD_CTR_IT] [int] NOT NULL,
	 CONSTRAINT [PK_EST_NF_ENT_DANFE_PROVISORIO_ITENS_ERRO_EAN] PRIMARY KEY CLUSTERED 
	(
		[CD_CTR] ASC,
		[CD_CTR_IT] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY]
	

	ALTER TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_ERRO_EAN]  WITH CHECK ADD  CONSTRAINT [FK_EST_NF_ENT_DANFE_PROVISORIO_ITENS_ERRO_EAN_EST_NF_ENT_DANFE_PROVISORIO_ITENS] FOREIGN KEY([CD_CTR], [CD_CTR_IT])
	REFERENCES [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS] ([CD_CTR], [CD_CTR_IT])
	ON UPDATE CASCADE
	ON DELETE CASCADE
	

	ALTER TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_ERRO_EAN] CHECK CONSTRAINT [FK_EST_NF_ENT_DANFE_PROVISORIO_ITENS_ERRO_EAN_EST_NF_ENT_DANFE_PROVISORIO_ITENS]
	
END
