IF  NOT EXISTS (SELECT * FROM sys.objects 
					WHERE object_id = OBJECT_ID(N'[dbo].[EST_PROD_TRANSF_EST_PED_ELTR]') 
					AND type in (N'U')) 
BEGIN

	/****** Object:  Table [dbo].[EST_PROD_TRANSF_EST_PED_ELTR]    Script Date: 25/08/2014 14:41:43 ******/
	SET ANSI_NULLS ON 
	SET QUOTED_IDENTIFIER ON 

	CREATE TABLE [dbo].[EST_PROD_TRANSF_EST_PED_ELTR](
		[CD_EMP] [int] NOT NULL,
		[CD_FILIAL] [int] NOT NULL,
		[CD_CTR] [int] NOT NULL,
		[CD_PED_SOL] [int] NOT NULL,	
	 CONSTRAINT [PK_EST_PROD_TRANSF_EST_PED_ELTR] PRIMARY KEY CLUSTERED 
	(
		[CD_EMP] ASC,
		[CD_FILIAL] 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_PROD_TRANSF_EST_PED_ELTR]  WITH NOCHECK ADD  
		CONSTRAINT [FK_EST_PROD_TRANSF_EST_PED_ELTR_EST_PROD_TRANSF] FOREIGN KEY([CD_EMP], [CD_FILIAL],[CD_CTR])
	REFERENCES [dbo].[EST_PROD_TRANSF] ([CD_EMP], [CD_FILIAL],[CD_CTR])
	ALTER TABLE [dbo].[EST_PROD_TRANSF_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PROD_TRANSF_EST_PED_ELTR_EST_PROD_TRANSF]
 
	ALTER TABLE [dbo].[EST_PROD_TRANSF_EST_PED_ELTR]  WITH NOCHECK ADD  
	CONSTRAINT [FK_EST_PROD_TRANSF_EST_PED_ELTR_EST_PED_ELTR] FOREIGN KEY([CD_EMP], [CD_PED_SOL])
	REFERENCES [dbo].[EST_PED_ELTR] ([CD_EMP], [CD_PED_SOL])
	ALTER TABLE [dbo].[EST_PROD_TRANSF_EST_PED_ELTR] CHECK CONSTRAINT [FK_EST_PROD_TRANSF_EST_PED_ELTR_EST_PED_ELTR]
 END