SALESORDERITEMMEMBERSHIPADDON

Stores membership add-on information for sales orders.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
ADDONTYPECODE tinyint Default = 0 Specifies the type of add-ons: additional member or guest.
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.
ADDONTYPE nvarchar(17) (Computed) yes CASE [ADDONTYPECODE] WHEN 0 THEN N'Benefit' WHEN 1 THEN N'Additional member' END

Foreign Keys

Foreign Key Field Type Null Notes Description
ID uniqueidentifier SALESORDERITEM.ID Primary Key.
MEMBERSHIPID uniqueidentifier yes MEMBERSHIP.ID The membership ID that add-on is associated to.
SALESORDERITEMMEMBERSHIPID uniqueidentifier yes SALESORDERITEMMEMBERSHIP.ID The sales order item membership ID that add-on is associated to.
MEMBERSHIPTRANSACTIONID uniqueidentifier yes MEMBERSHIPTRANSACTION.ID FK to MEMBERSHIPTRANSACTION table
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
ADDONID uniqueidentifier yes ADDON.ID
MEMBERSHIPADDONID uniqueidentifier yes MEMBERSHIPADDON.ID

Indexes

Index Name Fields Unique Primary Clustered
IX_SALESORDERITEMMEMBERSHIPADDON_DATEADDED DATEADDED yes
IX_SALESORDERITEMMEMBERSHIPADDON_DATECHANGED DATECHANGED
IX_SALESORDERITEMMEMBERSHIPADDON_MEMBERSHIPID MEMBERSHIPID
IX_SALESORDERITEMMEMBERSHIPADDON_SALESORDERITEMMEMBERSHIPID SALESORDERITEMMEMBERSHIPID
PK_SALESORDERITEMMEMBERSHIPADDON ID yes yes

Triggers

Trigger Name Description
TR_SALESORDERITEMMEMBERSHIPADDON_AUDIT_UPDATE
TR_SALESORDERITEMMEMBERSHIPADDON_AUDIT_DELETE