IF OBJECT_ID('EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR') IS NULL
	BEGIN 
	
		CREATE TABLE [dbo].[EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR](
			[CD_EMP] [int] NOT NULL,
			[CD_CTR] [int] NOT NULL,
			[CD_PED_SOL] [int] NOT NULL,
		 CONSTRAINT [PK_EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_CTR] 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_ATIVA_CP_EST_PED_ELTR]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_ATIVA_CP_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
		

		ALTER TABLE [dbo].[EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR_EST_PED_ELTR]
		

		ALTER TABLE [dbo].[EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR_EST_PED_ELTR_ATIVA_CP] FOREIGN KEY([CD_EMP], [CD_CTR])
		REFERENCES [dbo].[EST_PED_ELTR_ATIVA_CP] ([CD_EMP], [CD_CTR])
		ON UPDATE CASCADE
		ON DELETE CASCADE
		

		ALTER TABLE [dbo].[EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PED_ELTR_ATIVA_CP_EST_PED_ELTR_EST_PED_ELTR_ATIVA_CP]
		

	END