Skip to content

Instantly share code, notes, and snippets.

@kuzmik kuzmik/catalog.sql
Last active Aug 17, 2017

Embed
What would you like to do?
how NOT to design a database, courtesy your friends at Nexagen USA dot com
CREATE TABLE [dbo].[Catalog](
[SKU] [nvarchar](15) NOT NULL,
[brief_en_US] [varchar](100) NULL,
[highdescription_en_US] [ntext] NULL,
[lowdescription_en_US] [ntext] NULL,
[shipdescription_en_US] [varchar](100) NULL,
[brief_es_PR] [varchar](100) NULL,
[highdescription_es_PR] [ntext] NULL,
[lowdescription_es_PR] [ntext] NULL,
[BV] [int] NULL,
[PV] [int] NULL,
[DV] [int] NULL,
[Cost] [real] NOT NULL,
[DateEntered] [smalldatetime] NOT NULL,
[Sort] [int] NOT NULL,
[Weight] [real] NULL,
[Savings] [real] NULL,
[richmedialink] [nvarchar](255) NULL,
[MinDealerQty] [int] NULL,
[DealerBV] [int] NULL,
[CostofGoods] [real] NULL,
[CountryOfOrigin] [nvarchar](50) NULL,
[GoodsDescription] [ntext] NULL,
[UnitofMeasure] [nvarchar](25) NULL,
[UnitValue] [real] NULL,
[ShipmentWeight] [float] NULL,
[TermsofSale] [varchar](20) NULL,
[HarmonizedCode] [varchar](20) NULL,
[LabelUrl] [nvarchar](250) NULL,
[FreeShipping] [bit] NULL,
[pcBV] [int] NULL,
[Backordered] [bit] NULL,
[ShipsAlone] [bit] NULL,
[brief_de_DE] [varchar](100) NULL,
[highdescription_de_DE] [ntext] NULL,
[lowdescription_de_DE] [ntext] NULL,
[brief_it_IT] [varchar](100) NULL,
[highdescription_it_IT] [ntext] NULL,
[lowdescription_it_IT] [ntext] NULL,
[brief_en_GB] [varchar](100) NULL,
[highdescription_en_GB] [ntext] NULL,
[lowdescription_en_GB] [ntext] NULL,
[lowdescription_fr_FR] [ntext] NULL,
[highdescription_fr_FR] [ntext] NULL,
[brief_fr_FR] [varchar](100) NULL,
[Disabled] [bit] NULL,
[brief_cs_CZ] [nvarchar](100) NULL,
[highdescription_cs_CZ] [ntext] NULL,
[lowdescription_cs_CZ] [ntext] NULL,
[brief_tr_TR] [nvarchar](100) NULL,
[highdescription_tr_TR] [ntext] NULL,
[lowdescription_tr_TR] [ntext] NULL,
[brief_ru_ru] [nvarchar](100) NULL,
[highdescription_ru_ru] [ntext] NULL,
[lowdescription_ru_ru] [ntext] NULL,
[brief_hu_HU] [varchar](100) NULL,
[highdescription_hu_HU] [ntext] NULL,
[lowdescription_hu_HU] [ntext] NULL,
[brief_pl_PL] [nvarchar](100) NULL,
[highdescription_pl_PL] [ntext] NULL,
[lowdescription_pl_PL] [ntext] NULL
)
CREATE TABLE [dbo].[Members](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UserName] [nvarchar](50) NULL,
[AutoShipOffDate] [smalldatetime] NULL,
[OldPaidOnCard] [bit] NOT NULL,
[PaidOnCard] [bit] NOT NULL,
[SpecAutoShip] [bit] NOT NULL,
[LegPref] [nvarchar](5) NOT NULL,
[PosPref] [nvarchar](5) NOT NULL,
[LPBonusPayable] [real] NULL,
[RCommPayable] [real] NULL,
[BonusPayable] [real] NULL,
[ReVerified] [bit] NOT NULL,
[LPQualLeft] [bit] NULL,
[LPQualRight] [bit] NULL,
[LeaderPack] [bit] NULL,
[StarterPack] [bit] NULL,
[QualLeft] [bit] NULL,
[QualRight] [bit] NULL,
[DeleteWarnings] [int] NOT NULL,
[LastAutoShipDate] [smalldatetime] NULL,
[NextAutoShipDate] [smalldatetime] NULL,
[AutoShipSwitch] [bit] NOT NULL,
[AutoShipDay] [int] NULL,
[VerifiedDate] [datetime] NULL,
[AutoVerifyOrder] [int] NULL,
[VerifiedAmount] [real] NULL,
[AutoShipSKU] [nvarchar](15) NULL,
[PaMatrix] [int] NULL,
[PVLeg] [nvarchar](5) NULL,
[Leg] [nvarchar](5) NULL,
[MultiPack] [int] NULL,
[SponsorID] [int] NULL,
[Funds] [real] NOT NULL,
[PlacementFunds] [real] NOT NULL,
[EnrollerFunds] [real] NOT NULL,
[Payable] [real] NOT NULL,
[SpamBlock] [bit] NOT NULL,
[Disabled] [bit] NOT NULL,
[PaymentVerified] [bit] NOT NULL,
[Permission] [int] NULL,
[FirstName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[CurrentPayments] [real] NOT NULL,
[TIN] [nvarchar](25) NOT NULL,
[DisplayName] [nvarchar](100) NULL,
[Password] [nvarchar](50) NULL,
[Phone] [nvarchar](50) NULL,
[DisplayPhone] [nvarchar](50) NULL,
[SecondaryPhone] [nvarchar](50) NULL,
[FaxPhone] [nvarchar](50) NULL,
[Email] [nvarchar](100) NULL,
[Address1] [nvarchar](100) NULL,
[Address2] [nvarchar](100) NULL,
[City] [nvarchar](100) NULL,
[State] [nvarchar](100) NULL,
[Zip] [nvarchar](50) NULL,
[Country] [int] NULL,
[EntryDate] [smalldatetime] NULL,
[Comments] [ntext] NULL,
[CompanyName] [nvarchar](150) NULL,
[CompanyFax] [nvarchar](50) NULL,
[ipaddress] [nvarchar](50) NULL,
[AdminDst] [bit] NOT NULL,
[AdminMsg] [bit] NOT NULL,
[AdminOrd] [bit] NOT NULL,
[AdminInv] [bit] NOT NULL,
[AdminFin] [bit] NOT NULL,
[AdminCart] [bit] NOT NULL,
[AdminSys] [bit] NOT NULL,
[AdminPrg] [bit] NOT NULL,
[AdminSignup] [bit] NOT NULL,
[AdminReports] [bit] NOT NULL,
[AdminSing] [bit] NOT NULL,
[CCardType] [nvarchar](50) NULL,
[CCardNumber] [nvarchar](50) NULL,
[EncCCardNumber] [nvarchar](100) NULL,
[CCardCode] [nvarchar](50) NULL,
[CCardName] [nvarchar](100) NULL,
[CCardAddress] [nvarchar](100) NULL,
[CCardCity] [nvarchar](100) NULL,
[CCardState] [nvarchar](100) NULL,
[CCardZip] [nvarchar](50) NULL,
[CCardCountry] [int] NULL,
[CCardExp] [nvarchar](6) NULL,
[CheckName] [nvarchar](100) NULL,
[CheckAddress] [nvarchar](100) NULL,
[CheckCityStateZip] [nvarchar](100) NULL,
[CheckBankName] [nvarchar](100) NULL,
[CheckBankAddress] [nvarchar](100) NULL,
[CheckRouting] [nvarchar](100) NULL,
[CheckAccount] [nvarchar](100) NULL,
[CheckLicense] [nvarchar](50) NULL,
[CheckNumber] [nvarchar](10) NULL,
[WebContent] [ntext] NULL,
[GenealogyAlert] [bit] NOT NULL,
[CashCardNumber] [nvarchar](50) NOT NULL,
[CardTracking] [nvarchar](50) NULL,
[CardStatus] [nvarchar](50) NULL,
[DateShipped] [smalldatetime] NULL,
[Comm1] [int] NOT NULL,
[Comm2] [int] NULL,
[Comm3] [int] NULL,
[CommPd1] [int] NULL,
[CommPd2] [int] NULL,
[CommPd3] [int] NULL,
[FrontSideEmail] [bit] NOT NULL,
[WUMTCN] [varchar](30) NULL,
[optout] [bit] NOT NULL,
[PPSignup] [bit] NULL,
[ReadTerms] [bit] NULL,
[ebcbilled] [bit] NOT NULL,
[ebcexpiration] [datetime] NULL,
[usertype] [int] NULL,
[BonusPoints] [int] NULL,
[BonusPointDisplay] [bit] NULL,
[flushing] [bit] NOT NULL,
[MentorshipPayable] [real] NULL,
[WithheldThreshold] [int] NULL,
[EBCPaymentLate] [bit] NULL,
[QualifiedDate] [datetime] NULL,
[MailingAddress] [nvarchar](100) NULL,
[MailingAddress2] [nvarchar](100) NULL,
[MailingCity] [nvarchar](100) NULL,
[MailingState] [nvarchar](100) NULL,
[MailingZip] [nvarchar](50) NULL,
[EmailToNexAccount] [bit] NULL,
[EmailToNonNexAccount] [bit] NULL,
[CoOpAutoBuySwitch] [bit] NOT NULL,
[CoOpAutoBuyQty] [int] NULL,
[CoOpAutoBuySignup] [datetime] NULL,
[CoOpAutoBuyCancel] [datetime] NULL,
[NeedsMASUpdate] [bit] NOT NULL,
[ShippingPref] [varchar](10) NULL,
[datetaxexempt] [smalldatetime] NULL,
[taxexempt] [bit] NULL,
[AutoRenew] [bit] NULL,
[lang] [int] NULL,
[SimpleWebmail] [bit] NULL,
[UseDisplayName] [bit] NOT NULL,
[RequiredBV] [int] NULL,
[BVHikeNotified] [bit] NULL,
[StatusLevel] [smallint] NULL,
[UseCreditCard] [bit] NOT NULL,
[VATNumber] [nvarchar](20) NULL,
[CURPNumber] [nvarchar](50) NULL,
[RFCNumber] [nvarchar](50) NULL,
[ClickAndBuyCustID] [bigint] NULL,
[AutoshipPayMeth] [nvarchar](20) NULL,
[AutoshipLock] [bit] NULL,
[passportNum] [nvarchar](44) NULL,
[NexPayDate] [int] NULL,
[TerraCardNumber] [nvarchar](44) NULL,
[OldTerraCardNumber] [nvarchar](44) NULL,
[TerraCardIssued] [bit] NULL,
[NexPayLastBilled] [datetime] NULL,
[NexPayEnrolled] [bit] NULL,
[passportImagePath] [ntext] NULL,
[passportVerified] [bit] NULL,
[TerraCardEnrolled] [bit] NULL,
[TerraCardEnrolledDate] [datetime] NULL,
[NexPayPayable] [real] NULL,
[TerraCardIssuedDate] [datetime] NULL,
[EmailDeleteDate] [datetime] NULL,
[SentPassportNotification] [bit] NULL,
[PassportNotificationSentDate] [datetime] NULL,
[PassportNotificationType] [varchar](20) NULL,
[CommissionPendingEmailDate] [datetime] NULL,
[BirthDate] [datetime] NULL,
[ShippingCompany] [nvarchar](150) NULL,
[ShippingCountry] [nvarchar](150) NULL,
[SecondaryTaxID] [nvarchar](20) NULL,
[HighestStatusLevel] [int] NULL,
[DisabledDate] [datetime] NULL,
[LastLevelNotified] [smallint] NULL,
[PrincipalSSN] [nvarchar](25) NULL,
[AccountType] [nvarchar](25) NULL,
[PayVAT] [bit] NOT NULL,
[FailedLoginAttempts] [int] NOT NULL,
[LockOutDate] [datetime] NULL,
[PSP] [bit] NOT NULL,
[PaymentInfoChanged] [bit] NULL,
[HideLocation] [bit] NOT NULL,
[HasWebsite] [bit] NOT NULL,
[BVDropNotified] [bit] NOT NULL,
CONSTRAINT [PK_Members] 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],
CONSTRAINT [IX_Members] UNIQUE NONCLUSTERED
(
[UserName] 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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.