IF NOT EXISTS (
    SELECT 1 
    FROM sys.objects 
    WHERE object_id = OBJECT_ID('dbo.integra_ecommerce_loja') 
      AND type = 'U'
)
BEGIN

	CREATE TABLE [dbo].[integra_ecommerce_loja](
			[id] [bigint] IDENTITY(1,1) NOT NULL,
			[data_altercao] [datetime2](7) NULL,
			[data_cadastro] [datetime2](7) NULL,
			[bairro] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[cep] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
			[cnpj] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[codigo_eco] [int] NULL,
			[codigo_erp] [int] NULL,
			[codigo_municipio] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[complemento] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[inscricao_estadual] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[inscricao_municipal] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[logradouro] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[municipio] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[nome] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[numero] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[status_integracao] [int] NULL,
			[uf] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[RAZAO_SOCIAL] [varchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
			[TELEFONE] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
						PRIMARY KEY CLUSTERED 
						(
							[id] ASC
						)
	)
   
END
GO
