 
/****** Object:  Table [dbo].[EST_PED_ELTR_GRP_PED_EST_PED_ELTR]    Script Date: 06/05/2014 20:00:12 ******/
IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_PED_ELTR_GRP_PED_EST_PED_ELTR]') AND type in (N'U'))
	BEGIN
	
		CREATE TABLE [dbo].[EST_PED_ELTR_GRP_PED_EST_PED_ELTR](
			[CD_EMP] [int] NOT NULL,
			[CD_GRP_PED] [int] NOT NULL,
			[CD_PED_SOL] [int] NOT NULL,
		 CONSTRAINT [PK_EST_PED_ELTR_GRP_PED_EST_PED_ELTR] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_GRP_PED] ASC,
			[CD_PED_SOL] ASC
		)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
		) ON [PRIMARY]



		ALTER TABLE [dbo].[EST_PED_ELTR_GRP_PED_EST_PED_ELTR]  WITH NOCHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_GRP_PED_EST_PED_ELTR_EST_PED_ELTR] FOREIGN KEY([CD_EMP], [CD_PED_SOL])
		REFERENCES [dbo].[EST_PED_ELTR] ([CD_EMP], [CD_PED_SOL])
		ON UPDATE CASCADE
		ON DELETE CASCADE


		ALTER TABLE [dbo].[EST_PED_ELTR_GRP_PED_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PED_ELTR_GRP_PED_EST_PED_ELTR_EST_PED_ELTR]


		ALTER TABLE [dbo].[EST_PED_ELTR_GRP_PED_EST_PED_ELTR]  WITH NOCHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_GRP_PED_EST_PED_ELTR_EST_PED_ELTR_GRP_PED] FOREIGN KEY([CD_EMP], [CD_GRP_PED])
		REFERENCES [dbo].[EST_PED_ELTR_GRP_PED] ([CD_EMP], [CD_GRP_PED])
		ON UPDATE CASCADE
		ON DELETE CASCADE


		ALTER TABLE [dbo].[EST_PED_ELTR_GRP_PED_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PED_ELTR_GRP_PED_EST_PED_ELTR_EST_PED_ELTR_GRP_PED]

	END

