IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='E_DELIVERY_ENVIO_AUTOMATICO') 
BEGIN
CREATE TABLE [E_DELIVERY_ENVIO_AUTOMATICO] (
	[ID] int NOT NULL,
	[CD_FILIAL] int NOT NULL,
	[CD_PROD] int NOT NULL,
	[EAN] varchar(50) NOT NULL,
	[STATUS_ENVIO] int DEFAULT 0 NOT NULL,
	[ESTOQUE] int NOT NULL,
	[PRECO_VENDA] numeric(38,0) NOT NULL,
	[PRECO_OFERTA] numeric(38,0) NOT NULL,
	[DT_HR_ULT_ENVIO] datetime NULL,
	[PROTOCOLO] varchar(100) NULL,
	[MSG_LOG] varchar(100) NULL,
	[JSON_REQUEST] nvarchar(100) NULL,
	[JSON_RESPONSE] nvarchar(100) NULL
)
END
GO