Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 TYPECODE tinyint   Default = 0 The type of fee the item represents
 APPLIESTOCODE tinyint   Default = 0 The application type of fee
 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) CONVERT(bigint, TS) Numeric representation of the timestamp.
 APPLIESTO nvarchar(5) (Computed) CASE [APPLIESTOCODE] WHEN 0 THEN N'Order' WHEN 1 THEN N'Item' END Provides a translation for the 'APPLIESTOCODE' field.
 TYPE nvarchar(15) (Computed) CASE [TYPECODE] WHEN 0 THEN N'Delivery Method' WHEN 1 THEN N'Sales Method' WHEN 2 THEN N'Program' WHEN 3 THEN N'Rate Scale' END Provides a translation for the 'TYPECODE' field.
 FEENAME nvarchar(100)   Default = '' Name of fee at time of sale.

Foreign Key Field Type Null Notes Description
 ID uniqueidentifier   SALESORDERITEM.ID Primary Key.
 SALESORDERITEMID uniqueidentifier SALESORDERITEM.ID Sales order item the fee belongs to
 FEEID uniqueidentifier FEE.ID The fee used for this sales order item
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.

Index Name Field(s) Unique Primary Clustered
 IX_SALESORDERITEMFEE_DATEADDED DATEADDED    
 IX_SALESORDERITEMFEE_DATECHANGED DATECHANGED      
 IX_SALESORDERITEMFEE_SALESORDERITEMID SALESORDERITEMID      
 PK_SALESORDERITEMFEE ID  

Trigger Name Description
 TR_SALESORDERITEMFEE_AUDIT_UPDATE
 TR_SALESORDERITEMFEE_AUDIT_DELETE

Entity-Relationship diagram of this table