IF  NOT EXISTS (SELECT * FROM sys.objects 
					WHERE object_id = OBJECT_ID(N'[dbo].[GLB_GRP_USU_NT_MOV]') 
					AND type in (N'U')) 
 
BEGIN
	/****** Object:  Table [dbo].[GLB_GRP_USU_NT_MOV]    Script Date: 04/12/2014 17:12:50 ******/
	SET ANSI_NULLS ON 
	SET QUOTED_IDENTIFIER ON 

	CREATE TABLE [dbo].[GLB_GRP_USU_NT_MOV](
		[CD_GRP] [int] NOT NULL CONSTRAINT [DF_GLB_GRP_USU_NT_MOV_CD_GRP]  DEFAULT ((0)),
		[CD_MOV_OP] [int] NOT NULL CONSTRAINT [DF_GLB_GRP_USU_NT_MOV_CD_MOV_OP]  DEFAULT ((0)),
	 CONSTRAINT [PK_GLB_GRP_USU_NT_MOV] PRIMARY KEY CLUSTERED 
	(
		[CD_GRP] ASC,
		[CD_MOV_OP] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 85) ON [PRIMARY]
	) ON [PRIMARY]
 

	ALTER TABLE [dbo].[GLB_GRP_USU_NT_MOV]  WITH NOCHECK ADD  CONSTRAINT [FK_GLB_GRP_USU_NT_MOV_GLB_MOV_OP] FOREIGN KEY([CD_MOV_OP])
	REFERENCES [dbo].[GLB_MOV_OP] ([CD_MOV_OP])
	ON UPDATE CASCADE
	ON DELETE CASCADE
  
	ALTER TABLE [dbo].[GLB_GRP_USU_NT_MOV] CHECK CONSTRAINT [FK_GLB_GRP_USU_NT_MOV_GLB_MOV_OP]
 

	ALTER TABLE [dbo].[GLB_GRP_USU_NT_MOV]  WITH NOCHECK ADD  CONSTRAINT [FK_GLB_GRP_USU_NT_MOV_GLB_GRP_USU] FOREIGN KEY([CD_GRP])
	REFERENCES [dbo].[GLB_GRP_USU] ([CD_GRP])
	ON UPDATE CASCADE 
	ALTER TABLE [dbo].[GLB_GRP_USU_NT_MOV] CHECK CONSTRAINT [FK_GLB_GRP_USU_NT_MOV_GLB_GRP_USU]
END


