
/****** Object:  Table [dbo].[ApiCustomerLocations]    Script Date: 2021-09-06 21:06:42 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ApiCustomerLocations](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CustLocId] [int] NOT NULL,
	[ErpId] [int] NOT NULL,
	[CustId] [int] NOT NULL,
	[CustCustId] [int] NOT NULL,
	[OwnerId] [int] NOT NULL,
	[OwnerCustId] [int] NOT NULL,
	[Name] [nvarchar](max) NOT NULL,
	[Code] [nvarchar](100) NULL,
	[AdrrZip] [nvarchar](10) NULL,
	[AdrrCity] [nvarchar](50) NULL,
	[AdrrStreet] [nvarchar](100) NULL,
	[AdrrNumber] [nvarchar](30) NULL,
	[AdrrAppNumber] [nvarchar](20) NULL,
	[AdrrCountry] [nvarchar](40) NULL,
	[WWW] [nvarchar](max) NULL,
	[Phone] [nvarchar](20) NULL,
	[Phone2] [nvarchar](20) NULL,
	[Email] [nvarchar](40) NULL,
	[Notes] [nvarchar](max) NULL,
	[geolat] [float] NOT NULL,
	[geolong] [float] NOT NULL,
	[VendorId] [int] NOT NULL,
	[TS] [datetime] NOT NULL,
	[SaveTS] [int] NOT NULL,
	[DeviceUid] [nvarchar](100) NULL,
	[State] [int] NOT NULL,
	[CustErpId] [int] NOT NULL,
	[OwnerErpId] [int] NOT NULL,
 CONSTRAINT [PK_dbo.ApiCustomerLocations] 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]
GO

ALTER TABLE [dbo].[ApiCustomerLocations] ADD  DEFAULT ((0)) FOR [CustErpId]
GO

ALTER TABLE [dbo].[ApiCustomerLocations] ADD  DEFAULT ((0)) FOR [OwnerErpId]
GO


