IF  NOT EXISTS (SELECT * FROM sys.objects 
					WHERE object_id = OBJECT_ID(N'[dbo].[INTEGRA_EVENTOS]') 
					AND type in (N'U')) 
begin
CREATE TABLE [dbo].[INTEGRA_EVENTOS](
	[ID] [uniqueidentifier] NOT NULL,
	[TABELA] [sysname] NOT NULL,
	[CD_EMP] [int] NULL,
	[CD_FILIAL] [int] NULL,
	[CD_CTR] [int] NOT NULL,
	[TP_EVENTO] [int] NOT NULL,
	[HR_EVENTO] [datetime] NOT NULL,
	[ST_EVENTO] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[ID] 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].[INTEGRA_EVENTOS] ADD  DEFAULT (newid()) FOR [ID]

ALTER TABLE [dbo].[INTEGRA_EVENTOS] ADD  DEFAULT (getdate()) FOR [HR_EVENTO]

ALTER TABLE [dbo].[INTEGRA_EVENTOS] ADD  DEFAULT ((0)) FOR [ST_EVENTO]
end

