Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 CALCULATIONTYPECODE tinyint   Default = 0 The calculation type for the discount: 0 - Amount, 1 - Percentage.
 CALCULATIONTYPE nvarchar(11) (Computed) CASE [CALCULATIONTYPECODE] WHEN 0 THEN N'Amount off' WHEN 1 THEN N'Percent off' END Provides a translation for the 'CALCULATIONTYPECODE' field.
 PERCENT decimal(5, 2)   Default = 0.00 The percentage of a discount.
 AMOUNT money   Default = 0.00 The amount for a discount.
 DISCOUNTNAME nvarchar(100)   Default = '' Name of discount at time of sale.
 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.

Foreign Key Field Type Null Notes Description
 SALESORDERID uniqueidentifier   SALESORDER.ID FK to SALESORDER
 DISCOUNTREASONCODEID uniqueidentifier   DISCOUNTREASONCODE.ID The reason for the adjustable discount
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.

Index Name Field(s) Unique Primary Clustered
 IX_SALESORDERADJUSTABLEDISCOUNT_DATEADDED DATEADDED    
 IX_SALESORDERADJUSTABLEDISCOUNT_DATECHANGED DATECHANGED      
 PK_SALESORDERADJUSTABLEDISCOUNT ID  
 UIX_SALESORDERADJUSTABLEDISCOUNT_SALESORDERID SALESORDERID    

Trigger Name Description
 TR_SALESORDERADJUSTABLEDISCOUNT_AUDIT_UPDATE
 TR_SALESORDERADJUSTABLEDISCOUNT_AUDIT_DELETE

Entity-Relationship diagram of this table