PROMOTIONALCODE

Contains promotion code information

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
PROMOTIONALCODE nvarchar(50) Default = '' The Promotion Code for the discount.
VALIDFROM datetime yes Valid from date for the promotion code.
VALIDTO datetime yes Valid to date for the promotion code.
SEQUENCE int Default = 0 The sequence in which promotion codes are entered.
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.

Foreign Keys

Foreign Key Field Type Null Notes Description
DISCOUNTID uniqueidentifier DISCOUNT.ID The ID of the Discount the Promotion Code belongs to.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_PROMOTIONALCODE_DATEADDED DATEADDED yes
IX_PROMOTIONALCODE_DATECHANGED DATECHANGED
PK_PROMOTIONALCODE ID yes yes
UC_PROMOTIONALCODE_PROMOTIONALCODE PROMOTIONALCODE yes

Triggers

Trigger Name Description
TR_PROMOTIONALCODE_AUDIT_UPDATE
TR_PROMOTIONALCODE_AUDIT_DELETE