SALESORDERITEMMEMBERSHIP

Stores membership information for sales orders.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NUMBEROFCHILDREN smallint Default = ((0)) The number of children allowed on this membership.
COMMENTS nvarchar(1000) Default = '' Remarks about this membership.
ISGIFT bit Default = 0 Denotes that this membership is a gift.
SENDRENEWALCODE tinyint Default = 1 Specifies who to send renewals if this membership is a gift.
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.
EXPIRATIONDATE datetime yes The expiration date of this membership.
SENDRENEWAL nvarchar(24) (Computed) yes CASE [SENDRENEWALCODE] WHEN 0 THEN N'Giver' WHEN 1 THEN N'Primary member' WHEN 2 THEN N'Giver and primary member' END Provides a translation for the 'SENDRENEWALCODE' field.
MEMBERSHIPPROGRAMNAME nvarchar(100) Default = '' Name of membership program at time of sale.
TYPECODE tinyint Default = 1 Membership item type code.
TYPE nvarchar(15) (Computed) yes CASE [TYPECODE] WHEN 1 THEN N'Membership' WHEN 250 THEN N'Midterm upgrade' END Provides a translation for the 'TYPECODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
ID uniqueidentifier SALESORDERITEM.ID Primary Key.
MEMBERSHIPID uniqueidentifier yes MEMBERSHIP.ID The membership ID for rejoins and renews.
MEMBERSHIPPROGRAMID uniqueidentifier MEMBERSHIPPROGRAM.ID The membership program of this record.
MEMBERSHIPLEVELID uniqueidentifier MEMBERSHIPLEVEL.ID The membership level of this record.
MEMBERSHIPLEVELTERMID uniqueidentifier MEMBERSHIPLEVELTERM.ID The membership level term of this record.
MEMBERSHIPLEVELTYPECODEID uniqueidentifier yes MEMBERSHIPLEVELTYPECODE.ID The type of membership.
GIVENBYID uniqueidentifier yes CONSTITUENT.LOCALID The constituent that is responsible for giving the membership as a gift.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
MEMBERSHIPTRANSACTIONID uniqueidentifier yes MEMBERSHIPTRANSACTION.ID FK to MEMBERSHIPTRANSACTION table

Indexes

Index Name Fields Unique Primary Clustered
IX_SALESORDERITEMMEMBERSHIP_DATEADDED DATEADDED yes
IX_SALESORDERITEMMEMBERSHIP_DATECHANGED DATECHANGED
IX_SALESORDERITEMMEMBERSHIP_GIVENBYID GIVENBYID
PK_SALESORDERITEMMEMBERSHIP ID yes yes
UIX_SALESORDERITEMMEMBERSHIP_MEMBERSHIPTRANSACTIONID MEMBERSHIPTRANSACTIONID yes

Triggers

Trigger Name Description
TR_SALESORDERITEMMEMBERSHIP_AUDIT_UPDATE
TR_SALESORDERITEMMEMBERSHIP_AUDIT_DELETE

Referenced by

Referenced by Field
SALESORDERITEMMEMBER SALESORDERITEMMEMBERSHIPID
SALESORDERITEMMEMBERSHIPADDON SALESORDERITEMMEMBERSHIPID