Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 SALEDATE datetime   The date to use when posting the sold stock.
 SALEAMOUNT money   Default = 0 The price at which the stock was sold.
 FEE money   Default = 0 The fee payed to the broker in the stock sale.
 NUMBEROFUNITS decimal(20, 3)   Default = 0 The number of stock units sold.
 LOWPRICE decimal(19, 4)   Default = 0 The low price the stock sold for.
 MEDIANPRICE decimal(19, 4)   Default = 0 The median price the stock sold for.
 HIGHPRICE decimal(19, 4)   Default = 0 The high price the stock sold for.
 SALEPOSTDATE datetime The date to use when posting the sold stock record.
 SALEPOSTSTATUSCODE tinyint   Default = 1 Flag used to indicate whether sold stock has been posted, should be posted or needs to be posted.
 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.
 SALEPOSTSTATUS nvarchar(11) (Computed) CASE [SALEPOSTSTATUSCODE] WHEN 0 THEN N'Posted' WHEN 1 THEN N'Not Posted' WHEN 2 THEN N'Do Not Post' END Provides a translation for the 'SALEPOSTSTATUSCODE' field.
 ORGANIZATIONSALEAMOUNT money   Default = 0 The price at which the stock was sold in the organization currency.
 ORGANIZATIONFEE money   Default = 0 The fee payed to the broker in the stock sale in the organization currency.
 ORGANIZATIONLOWPRICE decimal(19, 4)   Default = 0 The low price the stock sold for in the organization currency.
 ORGANIZATIONMEDIANPRICE decimal(19, 4)   Default = 0 The median price of the stock in the organization currency.
 ORGANIZATIONHIGHPRICE decimal(19, 4)   Default = 0 The high price the stock sold for in the organization currency.
 TRANSACTIONSALEAMOUNT money   Default = 0 The price at which the stock was sold in the transaction currency.
 TRANSACTIONFEE money   Default = 0 The fee payed to the broker in the stock sale in the transaction currency.
 TRANSACTIONLOWPRICE decimal(19, 4)   Default = 0 The low price the stock sold for in the transaction currency.
 TRANSACTIONMEDIANPRICE decimal(19, 4)   Default = 0 The median price of the stock in the transaction currency.
 TRANSACTIONHIGHPRICE decimal(19, 4)   Default = 0 The high price the stock sold for in the transaction currency.

Foreign Key Field Type Null Notes Description
 STOCKDETAILID uniqueidentifier   STOCKDETAIL.ID FK to STOCKDETAIL
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 BASECURRENCYID uniqueidentifier CURRENCY.ID The base currency associated with this record.
 ORGANIZATIONEXCHANGERATEID uniqueidentifier CURRENCYEXCHANGERATE.ID The exchange rate used to calculate the organization amount.
 TRANSACTIONCURRENCYID uniqueidentifier CURRENCY.ID The transaction currency associated with this record.
 BASEEXCHANGERATEID uniqueidentifier CURRENCYEXCHANGERATE.ID The exchange rate used to calculate the base amount.

Index Name Field(s) Unique Primary Clustered
 IX_STOCKSALE_BASECURRENCYID BASECURRENCYID      
 IX_STOCKSALE_BASEEXCHANGERATEID BASEEXCHANGERATEID      
 IX_STOCKSALE_DATEADDED DATEADDED    
 IX_STOCKSALE_DATECHANGED DATECHANGED      
 IX_STOCKSALE_ORGANIZATIONEXCHANGERATEID ORGANIZATIONEXCHANGERATEID      
 IX_STOCKSALE_TRANSACTIONCURRENCYID TRANSACTIONCURRENCYID      
 PK_STOCKSALE ID  

Trigger Name Description
 TR_STOCKSALE_INSERTUPDATE_CURRENCY
 TR_STOCKSALE_T2BDELETE
 TR_STOCKSALE_AUDIT_UPDATE
 TR_STOCKSALE_AUDIT_DELETE

Referenced by Field
 STOCKSALEADJUSTMENT STOCKSALEID
 STOCKSALEGLDISTRIBUTION STOCKSALEID

Entity-Relationship diagram of this table