IF OBJECT_ID('EST_PROD_CPL_MEDIAP_AGENDA') IS NULL 
	BEGIN 
 
		CREATE TABLE [dbo].[EST_PROD_CPL_MEDIAP_AGENDA](
			[CD_EMP] [int] NOT NULL,
			[CD_AGD_MEDIAP] [int] NOT NULL,
			[DS_AGD_MEDIAP] [varchar](100) NULL,
			[CD_USU] [int] NULL,
			[DT_CAD] [datetime] NULL,
			[DT_ULT_ALT] [datetime] NULL,
			[STS_AGD_MEDIAP] [int] NULL,
			[DT_AGD_MEDIAP] [datetime] NULL,	
		 CONSTRAINT [PK_EST_PROD_CPL_MEDIAP_AGENDA] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_AGD_MEDIAP] ASC
		)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
		) ON [PRIMARY]

		

		SET ANSI_PADDING OFF

		ALTER TABLE [dbo].[EST_PROD_CPL_MEDIAP_AGENDA]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_CPL_MEDIAP_AGENDA_GLB_USU] FOREIGN KEY([CD_USU])
		REFERENCES [dbo].[GLB_USU] ([CD_USU])

		ALTER TABLE [dbo].[EST_PROD_CPL_MEDIAP_AGENDA] CHECK CONSTRAINT [FK_EST_PROD_CPL_MEDIAP_AGENDA_GLB_USU]

		ALTER TABLE [dbo].[EST_PROD_CPL_MEDIAP_AGENDA] ADD  CONSTRAINT [DF_EST_PROD_CPL_MEDIAP_AGENDA_STS_AGD_MEDIAP]  DEFAULT ((0)) FOR [STS_AGD_MEDIAP]
	
	END