IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='INTEGRA_ECOMMERCE_REGIAO_EST_PROD_TBL_DESC')
BEGIN
CREATE TABLE [dbo].[INTEGRA_ECOMMERCE_REGIAO_EST_PROD_TBL_DESC](
	[CD_REGIAO] [int] NOT NULL,
	[CD_EMP] [int] NOT NULL,
	[CD_TBL_DESC] [int] NOT NULL,
 CONSTRAINT [PK_INTEGRA_ECOMMERCE_REGIAO_EST_PROD_TBL_DESC] PRIMARY KEY CLUSTERED 
(
	[CD_REGIAO] ASC,
	[CD_EMP] ASC,
	[CD_TBL_DESC] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY];


ALTER TABLE [dbo].[INTEGRA_ECOMMERCE_REGIAO_EST_PROD_TBL_DESC]  WITH CHECK ADD  CONSTRAINT [FK_INTEGRA_ECOMMERCE_REGIAO_EST_PROD_TBL_DESC] FOREIGN KEY([CD_EMP], [CD_TBL_DESC])
REFERENCES [dbo].[EST_PROD_TBL_DESC] ([CD_EMP], [CD_TBL_DESC]);

ALTER TABLE [dbo].[INTEGRA_ECOMMERCE_REGIAO_EST_PROD_TBL_DESC] CHECK CONSTRAINT [FK_INTEGRA_ECOMMERCE_REGIAO_EST_PROD_TBL_DESC]
END


