/****** Object:  Table [dbo].[EST_PROD_TABLOIDE_EVENTOS]    Script Date: 05/20/2013 14:07:52 ******/
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_PROD_TABLOIDE_EVENTOS]') AND type in (N'U'))
begin
	CREATE TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS](
		[CD_CTR] [int] IDENTITY(1,1) NOT NULL,
		[CD_EMP] [int] NULL,
		[CD_TABLOIDE] [int] NULL,
		[EVENTO] [varchar](1500) NULL,
		[CD_USU] [int] NULL,
		[DT_CAD] [datetime] NULL,
	 CONSTRAINT [PK_EST_PROD_TABLOIDE_EVENTOS] 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) ON [PRIMARY]
	) ON [PRIMARY]

	ALTER TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_TABLOIDE_EVENTOS_EST_PROD_TABLOIDE] FOREIGN KEY([CD_EMP], [CD_TABLOIDE])
	REFERENCES [dbo].[EST_PROD_TABLOIDE] ([CD_EMP], [CD_TABLOIDE])

	ALTER TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS] CHECK CONSTRAINT [FK_EST_PROD_TABLOIDE_EVENTOS_EST_PROD_TABLOIDE]

	ALTER TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS] ADD  CONSTRAINT [DF_EST_PROD_TABLOIDE_EVENTOS_CD_EMP]  DEFAULT ((0)) FOR [CD_EMP]

	ALTER TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS] ADD  CONSTRAINT [DF_EST_PROD_TABLOIDE_EVENTOS_CD_TABLOIDE]  DEFAULT ((0)) FOR [CD_TABLOIDE]

	ALTER TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS] ADD  CONSTRAINT [DF_EST_PROD_TABLOIDE_EVENTOS_EVENTO]  DEFAULT ('') FOR [EVENTO]

	ALTER TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS] ADD  CONSTRAINT [DF_EST_PROD_TABLOIDE_EVENTOS_CD_USU]  DEFAULT ((0)) FOR [CD_USU]

	ALTER TABLE [dbo].[EST_PROD_TABLOIDE_EVENTOS] ADD  CONSTRAINT [DF_EST_PROD_TABLOIDE_EVENTOS_DT_CAD]  DEFAULT (getdate()) FOR [DT_CAD]
end

