/****** Object:  Table [dbo].[GLB_MOV_OP_CNT_CTB]    Script Date: 07/06/2012 11:09:58 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GLB_MOV_OP_CNT_CTB]') AND type in (N'U'))
DROP TABLE [dbo].[GLB_MOV_OP_CNT_CTB]
GO
GO
CREATE TABLE [dbo].[GLB_MOV_OP_CNT_CTB](
	[CD_MOV_OP] [int] NOT NULL,
	[TIPO_CONTA] [int] NOT NULL,
	[CD_CTB_CNT_DEB] [varchar](50) NOT NULL,
	[CD_CTB_CNT_RED_DEB] [int] NOT NULL,
	[CD_CTB_CNT_CRED] [varchar](50) NOT NULL,
	[CD_CTB_CNT_RED_CRED] [int] NOT NULL,
	[DS_MOV_OP_CONTABIL] [varchar](50) NOT NULL,
 CONSTRAINT [PK_GLB_MOV_OP_CNT_CTB] PRIMARY KEY CLUSTERED 
(
	[CD_MOV_OP] ASC,
	[TIPO_CONTA] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB]  WITH CHECK ADD  CONSTRAINT [FK_GLB_MOV_OP_CNT_CTB_GLB_MOV_OP] FOREIGN KEY([CD_MOV_OP])
REFERENCES [dbo].[GLB_MOV_OP] ([CD_MOV_OP])
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] CHECK CONSTRAINT [FK_GLB_MOV_OP_CNT_CTB_GLB_MOV_OP]
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] ADD  CONSTRAINT [DF_GLB_MOV_OP_CNT_CTB_CD_MOV_OP]  DEFAULT ((0)) FOR [CD_MOV_OP]
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] ADD  CONSTRAINT [DF_GLB_MOV_OP_CNT_CTB_TIPO_CONTA]  DEFAULT ((0)) FOR [TIPO_CONTA]
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] ADD  CONSTRAINT [DF_GLB_MOV_OP_CNT_CTB_CD_CTB_CNT_DEB]  DEFAULT ('') FOR [CD_CTB_CNT_DEB]
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] ADD  CONSTRAINT [DF_GLB_MOV_OP_CNT_CTB_CD_CTB_CNT_REB_DEB]  DEFAULT ((0)) FOR [CD_CTB_CNT_RED_DEB]
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] ADD  CONSTRAINT [DF_GLB_MOV_OP_CNT_CTB_CD_CTB_CNT_CRED]  DEFAULT ('') FOR [CD_CTB_CNT_CRED]
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] ADD  CONSTRAINT [DF_GLB_MOV_OP_CNT_CTB_CD_CTB_CNT_RED_CRED]  DEFAULT ((0)) FOR [CD_CTB_CNT_RED_CRED]
GO

ALTER TABLE [dbo].[GLB_MOV_OP_CNT_CTB] ADD  CONSTRAINT [DF_GLB_MOV_OP_CNT_CTB_DS_MOV_OP_CONTABIL]  DEFAULT ('') FOR [DS_MOV_OP_CONTABIL]
GO


