IF  NOT EXISTS (SELECT * FROM sys.objects 
					WHERE object_id = OBJECT_ID(N'[dbo].[EST_PROD_TBL_COMIS_REGRESSAO]') 
					AND type in (N'U')) 
BEGIN
CREATE TABLE [dbo].[EST_PROD_TBL_COMIS_REGRESSAO](
	[CD_EMP] [int] NOT NULL,
	[CD_TBL_COMIS_REGRESSAO] [int] NOT NULL,
	[DS_TBL_COMIS_REGRESSAO] [varchar](150) NOT NULL,
	[CD_USU] [int] NOT NULL,
	[DT_CAD] [datetime] NOT NULL,
	[DT_ULT_ALT] [datetime] NULL,
 CONSTRAINT [PK_EST_PROD_TBL_COMIS_REGRESSAO] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_TBL_COMIS_REGRESSAO] 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_PROD_TBL_COMIS_REGRESSAO] ADD  CONSTRAINT [DF_EST_PROD_TBL_COMIS_REGRESSAO_CD_EMP]  DEFAULT ((0)) FOR [CD_EMP]

ALTER TABLE [dbo].[EST_PROD_TBL_COMIS_REGRESSAO] ADD  CONSTRAINT [DF_EST_PROD_TBL_COMIS_REGRESSAO_CD_TBL_COMIS_REGRESSAO]  DEFAULT ((0)) FOR [CD_TBL_COMIS_REGRESSAO]

ALTER TABLE [dbo].[EST_PROD_TBL_COMIS_REGRESSAO] ADD  CONSTRAINT [DF_EST_PROD_TBL_COMIS_REGRESSAO_DS_TBL_COMIS_REGRESSAO]  DEFAULT ('') FOR [DS_TBL_COMIS_REGRESSAO]

ALTER TABLE [dbo].[EST_PROD_TBL_COMIS_REGRESSAO] ADD  CONSTRAINT [DF_EST_PROD_TBL_COMIS_REGRESSAO_CD_USU]  DEFAULT ((0)) FOR [CD_USU]
end

