MKTMARKETINGPLANITEMEXPENSE

Stores information pertaining to an instance of a level in a marketing plan.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DESCRIPTION nvarchar(max) Default = ''
EXPENSETYPECODE tinyint Default = 0 The type of this expense; controls how the total expense is calculated.
EXPENSETYPE nvarchar(12) (Computed) yes CASE [EXPENSETYPECODE] WHEN 0 THEN N'Fixed cost' WHEN 1 THEN N'Per unit' WHEN 2 THEN N'Per response' END Provides a translation for the 'EXPENSETYPECODE' field.
COUNT int Default = 1
UNITCOUNT int Default = 1 The number of items that constitutes one unit for this expense.
AMOUNT money Default = 0 The base monetary amount for this expense, stored in its base currency.
BUDGETAMOUNT money Default = 0 Total monetary amount budgeted for this expense, stored in its base currency.
SEQUENCE int 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.
ORGANIZATIONAMOUNT money Default = 0 The base monetary amount for this expense, stored in the organization currency.
ORGANIZATIONBUDGETAMOUNT money Default = 0 Total monetary amount budgeted for this expense, stored in the organization currency.

Foreign Keys

Foreign Key Field Type Null Notes Description
MARKETINGPLANITEMID uniqueidentifier MKTMARKETINGPLANITEM.ID The marketing plan item to which this expense belongs.
EXPENSECATEGORYCODEID uniqueidentifier yes MKTEXPENSECATEGORYCODE.ID The category for this expense.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
BASECURRENCYID uniqueidentifier yes CURRENCY.ID The base currency associated with this expense.
CURRENCYEXCHANGERATEID uniqueidentifier yes CURRENCYEXCHANGERATE.ID The exchange rate used to convert base currency amounts to organization amounts.

Indexes

Index Name Fields Unique Primary Clustered
IX_MKTMARKETINGPLANITEMEXPENSE_BASECURRENCYID BASECURRENCYID
IX_MKTMARKETINGPLANITEMEXPENSE_CURRENCYEXCHANGERATEID CURRENCYEXCHANGERATEID
IX_MKTMARKETINGPLANITEMEXPENSE_DATEADDED DATEADDED yes
IX_MKTMARKETINGPLANITEMEXPENSE_DATECHANGED DATECHANGED
IX_MKTMARKETINGPLANITEMEXPENSE_MARKETINGPLANITEMID MARKETINGPLANITEMID
PK_MKTMARKETINGPLANITEMEXPENSE ID yes yes

Triggers

Trigger Name Description
TR_MKTMARKETINGPLANITEMEXPENSE_AUDIT_UPDATE
TR_MKTMARKETINGPLANITEMEXPENSE_AUDIT_DELETE
TR_MKTMARKETINGPLANITEMEXPENSE_INSERTUPDATE_CURRENCY