IF OBJECT_ID('CG_FND_VERBA_FECHAMENTO') IS NULL
begin
	CREATE TABLE [dbo].[CG_FND_VERBA_FECHAMENTO](
		[CD_FND_VERBA_FECHAMENTO] [int] NOT NULL,
		[CD_EMP] [int] NOT NULL,
		[CD_FND_VERBA] [int] NOT NULL,
		[VLR_FND_VERBA_FECHAMENTO] [money] NOT NULL,
		[DT_CAD] [datetime] NOT NULL,
		[CD_USU] [int] NOT NULL,
		[DT_FECHAMENTO] [datetime] NOT NULL,
	 CONSTRAINT [PK_CG_FND_VERBA_FECHAMENTO] PRIMARY KEY CLUSTERED 
	(
		[CD_FND_VERBA_FECHAMENTO] 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].[CG_FND_VERBA_FECHAMENTO]  WITH CHECK ADD  CONSTRAINT [FK_CG_FND_VERBA_FECHAMENTO_CG_FND_VERBA] FOREIGN KEY([CD_FND_VERBA], [CD_EMP])
	REFERENCES [dbo].[CG_FND_VERBA] ([CD_FND_VERBA], [CD_EMP])

	ALTER TABLE [dbo].[CG_FND_VERBA_FECHAMENTO] CHECK CONSTRAINT [FK_CG_FND_VERBA_FECHAMENTO_CG_FND_VERBA]
end
