
IF OBJECT_ID('EST_ALCADA_CP') IS NULL	
	BEGIN
		CREATE TABLE [dbo].[EST_ALCADA_CP](
			[CD_ALCADA] [int] NOT NULL,
			[DS_ALCADA] VARCHAR(100) NOT NULL,
			[TP_ALCADA] [int] NOT NULL,			
			[CD_USU] [int] NULL,
			[DT_CAD] [datetime] NULL,
			[DT_ULT_ALT] [datetime] NULL,			
		 CONSTRAINT [PK_EST_ALCADA_CP] PRIMARY KEY CLUSTERED 
		(
			[CD_ALCADA] 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_ALCADA_CP]  WITH CHECK ADD  CONSTRAINT [FK_EST_ALCADA_CP_GLB_USU] FOREIGN KEY([CD_USU])
		REFERENCES [dbo].[GLB_USU] ([CD_USU])

		ALTER TABLE [dbo].[EST_ALCADA_CP] CHECK CONSTRAINT [FK_EST_ALCADA_CP_GLB_USU]

		ALTER TABLE [dbo].[EST_ALCADA_CP] ADD  CONSTRAINT [DF_EST_ALCADA_CP_TP_ALCADA]  DEFAULT ((0)) FOR [TP_ALCADA]

	END

