IF OBJECT_ID('EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT') IS NULL	
	BEGIN
		CREATE TABLE [dbo].[EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT](
			[CD_EMP] [int] NOT NULL,
			[CD_FILIAL] [int] NOT NULL,
			[CD_REQ] [int] NOT NULL,			
			[CD_PED_WMS] [int] NOT NULL
		 CONSTRAINT [PK_EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT] PRIMARY KEY CLUSTERED 
		(

			[CD_EMP] ASC,
			[CD_FILIAL] ASC,
			[CD_REQ] ASC,
			[CD_PED_WMS] ASC

		)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
		) ON [PRIMARY]
		

		ALTER TABLE [dbo].[EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT_EST_PROD_REQ_TRANSF_LIB] FOREIGN KEY([CD_EMP], [CD_FILIAL],[CD_REQ])
		REFERENCES [dbo].[EST_PROD_REQ_TRANSF_LIB] ([CD_EMP], [CD_FILIAL],[CD_REQ])

		

		ALTER TABLE [dbo].[EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT] CHECK CONSTRAINT [FK_EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT_EST_PROD_REQ_TRANSF_LIB]

		

		ALTER TABLE [dbo].[EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT_EST_WMS_ENT] FOREIGN KEY([CD_PED_WMS])
		REFERENCES [dbo].[EST_WMS_ENT] ([CD_PED_WMS])

		

		ALTER TABLE [dbo].[EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT] CHECK CONSTRAINT [FK_EST_PROD_REQ_TRANSF_LIB_EST_WMS_ENT_EST_WMS_ENT]
		


	END