Revention Customer


USE [Revention]
GO

/****** Object:  Table [dbo].[Customer]    Script Date: 08/20/2018 09:36:32 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Customer](
	[CustomerKey] [int] IDENTITY(1,1) NOT NULL,
	[AddrKey] [int] NULL,
	[LastName] [nvarchar](25) NULL,
	[FirstName] [nvarchar](25) NULL,
	[CustID] [nvarchar](25) NULL,
	[SpNote] [nvarchar](100) NOT NULL,
	[DelNote] [nvarchar](100) NOT NULL,
	[FirstOrdDate] [datetime] NULL,
	[LastOrdDate] [datetime] NULL,
	[LastOrdNum] [int] NOT NULL,
	[OrdCnt] [int] NOT NULL,
	[OrdAmt] [money] NOT NULL,
	[TaxExempt] [bit] NOT NULL,
	[TaxNum] [nvarchar](25) NULL,
	[AcceptChecks] [bit] NOT NULL,
	[LastChanged] [smalldatetime] NULL,
	[Created] [smalldatetime] NULL,
	[BadChecksCust] [bit] NOT NULL,
	[PctDiscount] [decimal](18, 3) NOT NULL,
	[Points] [int] NOT NULL,
	[Email] [nvarchar](80) NOT NULL,
	[PctDiscAppr] [int] NOT NULL,
	[FirstOLDate] [datetime] NULL,
	[LastOLDate] [datetime] NULL,
	[OLCnt] [int] NOT NULL,
	[OLAmt] [money] NOT NULL,
	[OptOut] [bit] NOT NULL,
	[LoyaltyPoints] [int] NOT NULL,
	[LoyaltyCredit] [money] NOT NULL,
	[AVSZip] [nvarchar](10) NOT NULL,
	[AVSStNum] [nvarchar](8) NOT NULL,
	[AVSManual] [bit] NOT NULL,
	[CpnUsage] [nvarchar](120) NOT NULL,
	[RewardsMember] [bit] NOT NULL,
	[LoyaltyNum] [nvarchar](30) NOT NULL,
	[EntSync] [datetime] NULL,
	[SyncStatus] [int] NOT NULL,
	[EntID] [int] NOT NULL,
 CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED 
(
	[CustomerKey] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF_Customer_SpNote]  DEFAULT (N' ') FOR [SpNote]
GO

ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF_Customer_DelNote]  DEFAULT (N' ') FOR [DelNote]
GO

ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF_Customer_LastOrdNum]  DEFAULT (0) FOR [LastOrdNum]
GO

ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF_Customer_OrdCnt]  DEFAULT (0) FOR [OrdCnt]
GO

ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF_Customer_OrdAmt]  DEFAULT (0) FOR [OrdAmt]
GO

ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF_Customer_TaxExempt]  DEFAULT (0) FOR [TaxExempt]
GO

ALTER TABLE [dbo].[Customer] ADD  CONSTRAINT [DF_Customer_AcceptChecks]  DEFAULT (0) FOR [AcceptChecks]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT (0) FOR [BadChecksCust]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT (0) FOR [PctDiscount]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [Points]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ('') FOR [Email]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [PctDiscAppr]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [OLCnt]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [OLAmt]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [OptOut]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [LoyaltyPoints]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [LoyaltyCredit]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ('') FOR [AVSZip]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ('') FOR [AVSStNum]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [AVSManual]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ('') FOR [CpnUsage]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [RewardsMember]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ('') FOR [LoyaltyNum]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [SyncStatus]
GO

ALTER TABLE [dbo].[Customer] ADD  DEFAULT ((0)) FOR [EntID]
GO