IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=N'GLB_USU_AGENDA')
 BEGIN
  SET ANSI_NULLS ON
  SET QUOTED_IDENTIFIER ON
  CREATE TABLE [dbo].[GLB_USU_AGENDA](
   [CD_CTR] [int] IDENTITY (1,1) NOT NULL,
   [TITULO] [varchar](100) collate SQL_Latin1_General_CP1_CI_AS NOT NULL,
   [COR]  [varchar](10) collate SQL_Latin1_General_CP1_CI_AS NOT NULL,
   [DT_INI] [datetime] NOT NULL,
   [DT_FIM] [datetime] NOT NULL,  
   [URL]   [varchar](200) collate SQL_Latin1_General_CP1_CI_AS,
   [PARAMETROS] [varchar](200) collate SQL_Latin1_General_CP1_CI_AS,
   [NAO_POSSUI_HR_INICIO_E_FIM] [tinyint] NOT NULL,
   [EVENT_BLOQ_EDICAO_ANTERIORMENTE] [tinyint] NOT NULL,
   [EDITAVEL] [tinyint] NOT NULL, 
   [CD_USU] [int] NOT NULL,
   [DT_CAD] [datetime] NULL,
   CONSTRAINT [PK_GLB_USU_AGENDA] PRIMARY KEY CLUSTERED 
  ( [CD_CTR] 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].[GLB_USU_AGENDA]  WITH CHECK ADD  
    CONSTRAINT [FK_GLB_USU_AGENDA_GLB_USU] FOREIGN KEY([CD_USU])
    REFERENCES [dbo].[GLB_USU] ([CD_USU])
   ALTER TABLE [dbo].[GLB_USU_AGENDA] CHECK CONSTRAINT [FK_GLB_USU_AGENDA_GLB_USU]
 END