SALESORDERITEMITEMDISCOUNT

Defines the link between a sales order item and an item-level discount

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
AMOUNT money Default = 0
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.
DISCOUNTNAME nvarchar(100) Default = '' Name of discount at time of sale.
NUMBEROFDISCOUNTEDITEMS int Default = 0

Foreign Keys

Foreign Key Field Type Null Notes Description
SALESORDERITEMID uniqueidentifier SALESORDERITEM.ID Sales order item being discounted
DISCOUNTID uniqueidentifier DISCOUNT.ID FK to DISCOUNT
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_SALESORDERITEMITEMDISCOUNT_DATEADDED DATEADDED yes
IX_SALESORDERITEMITEMDISCOUNT_DATECHANGED DATECHANGED
IX_SALESORDERITEMITEMDISCOUNT_DISCOUNTID DISCOUNTID
IX_SALESORDERITEMITEMDISCOUNT_SALESORDERITEMID SALESORDERITEMID
PK_SALESORDERITEMITEMDISCOUNT ID yes yes

Triggers

Trigger Name Description
TR_SALESORDERITEMITEMDISCOUNT_AUDIT_UPDATE
TR_SALESORDERITEMITEMDISCOUNT_AUDIT_DELETE

Referenced by

Referenced by Field
CREDITITEMITEMDISCOUNT SALESORDERITEMITEMDISCOUNTID