IF OBJECT_ID('EST_PED_CP_PARAM_PRC_FILIAL') IS NULL
	BEGIN 
	
		CREATE TABLE [dbo].[EST_PED_CP_PARAM_PRC_FILIAL](
			[CD_EMP] [int] NOT NULL,
			[CD_PED_CP_PARAM] [int] NOT NULL,
			[CD_FILIAL] [int] NOT NULL,
		 CONSTRAINT [PK_EST_PED_CP_PARAM_PRC_FILIAL] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_PED_CP_PARAM] ASC,
			[CD_FILIAL] 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_CP_PARAM_PRC_FILIAL]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_CP_PARAM_PRC_FILIAL_EST_PED_CP_PARAM] FOREIGN KEY([CD_EMP], [CD_PED_CP_PARAM])
		REFERENCES [dbo].[EST_PED_CP_PARAM] ([CD_EMP], [CD_PED_CP_PARAM])
		ON UPDATE CASCADE
		ON DELETE CASCADE
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM_PRC_FILIAL] CHECK CONSTRAINT [FK_EST_PED_CP_PARAM_PRC_FILIAL_EST_PED_CP_PARAM]
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM_PRC_FILIAL]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_CP_PARAM_PRC_FILIAL_PRC_FILIAL] FOREIGN KEY([CD_EMP], [CD_FILIAL])
		REFERENCES [dbo].[PRC_FILIAL] ([CD_EMP], [CD_FILIAL])
		ON UPDATE CASCADE
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM_PRC_FILIAL] CHECK CONSTRAINT [FK_EST_PED_CP_PARAM_PRC_FILIAL_PRC_FILIAL]
		

	END