IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='EST_PROD_ZERAR_DESCONTOS_OFERTA_TEMP') 
BEGIN
	CREATE TABLE [dbo].[EST_PROD_ZERAR_DESCONTOS_OFERTA_TEMP](
		[CD_EMP] [int] NOT NULL,
		[CD_CTR] [int] IDENTITY(1,1) NOT NULL,
		[DS_CAD] [VARCHAR](100) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS NOT NULL,
		[DT_INI] [DATETIME] NOT NULL,
		[DT_FIM] [datetime] NOT NULL,
		[CD_USU] [int] NOT NULL,
		[DT_CAD] [datetime] NOT NULL,
		[CD_USU_ATU] [int] NULL,
		[DT_ULT_ATU] [datetime] NULL,
	 CONSTRAINT [PK_EST_PROD_ZERAR_DESCONTOS_OFERTA_TEMP] PRIMARY KEY CLUSTERED 
	(
		[CD_EMP] ASC,
		[CD_CTR] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 97) ON [PRIMARY]
	) ON [PRIMARY]

	ALTER TABLE [dbo].[EST_PROD_ZERAR_DESCONTOS_OFERTA_TEMP]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_ZERAR_DESCONTOS_OFERTA_TEMP_GLB_USU] FOREIGN KEY([CD_USU])
	REFERENCES [dbo].[GLB_USU] ([CD_USU])

	ALTER TABLE [dbo].[EST_PROD_ZERAR_DESCONTOS_OFERTA_TEMP]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_ZERAR_DESCONTOS_OFERTA_TEMP_GLB_USU_ATU] FOREIGN KEY([CD_USU_ATU])
	REFERENCES [dbo].[GLB_USU] ([CD_USU])
END
