IF OBJECT_ID('EST_PED_CP_PARAM') IS NULL	
	BEGIN 

		CREATE TABLE [dbo].[EST_PED_CP_PARAM](
			[CD_EMP] [int] NOT NULL,
			[CD_PED_CP_PARAM] [int] NOT NULL,
			[DS_PED_CP_PARAM] [varchar](100) NOT NULL,
			[CD_USU] [int] NOT NULL,
			[DT_CAD] [datetime] NOT NULL,
			[DT_ULT_ALT] [datetime] NULL,
			[STS_PED_CP_PARAM] [int] NULL,
			[FLAG_TODAS_FILIAIS] [int] NULL,
			[FLAG_FALTAS_MCP] [int] NULL,
			[TP_FILTRO_PHLINK] [int] NULL,
		 CONSTRAINT [PK_EST_PED_CP_PARAM] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_PED_CP_PARAM] 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]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_CP_PARAM_GLB_USU] FOREIGN KEY([CD_USU])
		REFERENCES [dbo].[GLB_USU] ([CD_USU])
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM] CHECK CONSTRAINT [FK_EST_PED_CP_PARAM_GLB_USU]
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_CP_PARAM_PRC_EMP] FOREIGN KEY([CD_EMP])
		REFERENCES [dbo].[PRC_EMP] ([CD_EMP])
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM] CHECK CONSTRAINT [FK_EST_PED_CP_PARAM_PRC_EMP]
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM] ADD  CONSTRAINT [DF_EST_PED_CP_PARAM_STS_PED_CP_PARAM]  DEFAULT ((0)) FOR [STS_PED_CP_PARAM]
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM] ADD  CONSTRAINT [DF_EST_PED_CP_PARAM_FLAG_TODAS_FILIAIS]  DEFAULT ((0)) FOR [FLAG_TODAS_FILIAIS]
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM] ADD  CONSTRAINT [DF_EST_PED_CP_PARAM_FLAG_FALTAS_MCP]  DEFAULT ((0)) FOR [FLAG_FALTAS_MCP]
		

		ALTER TABLE [dbo].[EST_PED_CP_PARAM] ADD  CONSTRAINT [DF_EST_PED_CP_PARAM_TP_FILTRO_PHLINK]  DEFAULT ((0)) FOR [TP_FILTRO_PHLINK]
		

	END