IF OBJECT_ID('TENTACLE_SYNC_MONITOR') IS NULL

BEGIN
CREATE TABLE [dbo].[TENTACLE_SYNC_MONITOR](
	[ID] [varchar](40) NOT NULL,
	[TABELA] [varchar](100) NOT NULL,
	[AGENTE] [varchar](100) NOT NULL,
	[QUEUE] [varchar](300) NOT NULL,
	[SQL] [text] NOT NULL,
	[STATUS] [int] NOT NULL,
	[COUNT] [int] NULL,
	[DATE] [datetime] NULL,
	[ATTEMPTS] [int] NULL,
	[TABELA_DEST] [varchar](100) NULL,
	[LAST_VERSION] [bigint] NULL,
	[LAST_ERROR] [text] NULL,
	[AGENTE_VERSION] [text] 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] TEXTIMAGE_ON [PRIMARY]
END

