IF OBJECT_ID('CTB_CNT_DRE_PROCESSAMENTO') IS NULL
BEGIN
CREATE TABLE [dbo].[CTB_CNT_DRE_PROCESSAMENTO](
	[CD_CTR] [int] IDENTITY(1,1) NOT NULL,
	[MES] [int] NOT NULL,
	[ANO] [int] NOT NULL,
	[DT_SOLICITACAO] [datetime] NOT NULL,
	[DT_INI_PROCESSAMENTO] [datetime] NULL,
	[TP_DRE] [int] NOT NULL,
	[TP_RAT_CENTRO_CUSTO] [int] NOT NULL,
	[CD_USU] [int] NOT NULL,
	[DT_FIM_PROCESSAMENTO] [datetime] NULL,
 CONSTRAINT [PK_CTB_CNT_DRE_PROCESSAMENTO] PRIMARY KEY CLUSTERED 
(
	[CD_CTR] 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].[CTB_CNT_DRE_PROCESSAMENTO] ADD  CONSTRAINT [DF_CTB_CNT_DRE_PROCESSAMENTO_MES]  DEFAULT ((0)) FOR [MES]

ALTER TABLE [dbo].[CTB_CNT_DRE_PROCESSAMENTO] ADD  CONSTRAINT [DF_CTB_CNT_DRE_PROCESSAMENTO_ANO]  DEFAULT ((0)) FOR [ANO]

ALTER TABLE [dbo].[CTB_CNT_DRE_PROCESSAMENTO] ADD  CONSTRAINT [DF_CTB_CNT_DRE_PROCESSAMENTO_DT_SOLICITACAO]  DEFAULT (getdate()) FOR [DT_SOLICITACAO]

ALTER TABLE [dbo].[CTB_CNT_DRE_PROCESSAMENTO] ADD  CONSTRAINT [DF_CTB_CNT_DRE_PROCESSAMENTO_TP_DRE]  DEFAULT ((0)) FOR [TP_DRE]

ALTER TABLE [dbo].[CTB_CNT_DRE_PROCESSAMENTO] ADD  CONSTRAINT [DF_CTB_CNT_DRE_PROCESSAMENTO_TP_RAT_CENTO_CUSTO]  DEFAULT ((0)) FOR [TP_RAT_CENTRO_CUSTO]

ALTER TABLE [dbo].[CTB_CNT_DRE_PROCESSAMENTO] ADD  CONSTRAINT [DF_CTB_CNT_DRE_PROCESSAMENTO_CD_USU]  DEFAULT ((1)) FOR [CD_USU]
END