IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES
			 WHERE TABLE_NAME='PRC_FILIAL_EST_FECHA')
BEGIN
CREATE TABLE [dbo].[PRC_FILIAL_EST_FECHA](
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[ANO_FECHA] [int] NOT NULL,
	[MES_FECHA] [int] NOT NULL,
	[CD_USU] [int] NOT NULL,
	[DT_CAD] [datetime] NOT NULL,
 CONSTRAINT [PK_PRC_FILIAL_EST_FECHA] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[ANO_FECHA] ASC,
	[MES_FECHA] 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].[PRC_FILIAL_EST_FECHA]  WITH CHECK ADD  CONSTRAINT [FK_PRC_FILIAL_EST_FECHA_PRC_FILIAL] FOREIGN KEY([CD_EMP], [CD_FILIAL])
REFERENCES [dbo].[PRC_FILIAL] ([CD_EMP], [CD_FILIAL])

ALTER TABLE [dbo].[PRC_FILIAL_EST_FECHA] CHECK CONSTRAINT [FK_PRC_FILIAL_EST_FECHA_PRC_FILIAL]
end