Describes a membership promotion sales item
Primary Key
Primary Key |
Field Type |
ID |
uniqueidentifier |
Fields
Field |
Field Type |
Null |
Notes |
Description |
MEMBERSHIPPROMONAME |
nvarchar(100) |
|
Default = '' |
Name of promotion at time of sale. |
EXTENSIONCALCULATIONTYPECODE |
tinyint |
|
Default = 0 |
The type of term extension: 0 - Day, 1 - Month |
EXTENSIONCALCULATIONTYPE |
nvarchar(12) (Computed) |
yes |
CASE [EXTENSIONCALCULATIONTYPECODE] WHEN 0 THEN N'Days added' WHEN 1 THEN N'Months added' END |
Provides a translation for the 'EXTENSIONCALCULATIONTYPECODE' field. |
EXTENSIONVALUE |
int |
|
Default = 0 |
The number of days/months to extend the term by. |
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. |
PROMOTIONALCODE |
nvarchar(50) |
|
Default = '' |
The Promotion Code used to apply the discount. |
INUSE |
bit |
|
Default = 0 |
Indicates this promo is being applied to the order |
Foreign Keys
Foreign Key |
Field Type |
Null |
Notes |
Description |
ID |
uniqueidentifier |
|
SALESORDERITEM.ID
|
Primary Key. |
MEMBERSHIPPROMOID |
uniqueidentifier |
|
MEMBERSHIPPROMO.ID
|
Membership promotion being applied to the order |
ADDEDBYID |
uniqueidentifier |
|
CHANGEAGENT.ID
|
FK to CHANGEAGENT. |
CHANGEDBYID |
uniqueidentifier |
|
CHANGEAGENT.ID
|
FK to CHANGEAGENT. |
Indexes
Index Name |
Fields |
Unique |
Primary |
Clustered |
IX_SALESORDERITEMMEMBERSHIPPROMO_DATEADDED |
DATEADDED |
|
|
yes |
IX_SALESORDERITEMMEMBERSHIPPROMO_DATECHANGED |
DATECHANGED |
|
|
|
PK_SALESORDERITEMMEMBERSHIPPROMO |
ID |
yes |
yes |
|
Triggers