SALESORDERMARKETINGSURVEYRESPONSE

Stores information about a marketing survey given in a sales order.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NOTCOLLECTED bit Default = 0 When true indicates that the constituent declined to respond.
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.

Foreign Keys

Foreign Key Field Type Null Notes Description
SALESORDERID uniqueidentifier SALESORDER.ID The sales order.
MARKETINGSURVEYQUESTIONID uniqueidentifier MARKETINGSURVEYQUESTION.ID The marketing survey question asked.
MARKETINGSURVEYANSWERID uniqueidentifier yes MARKETINGSURVEYANSWER.ID The preset answer chosen by the constituent.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_SALESORDERMARKETINGSURVEYRESPONSE_DATEADDED DATEADDED yes
IX_SALESORDERMARKETINGSURVEYRESPONSE_DATECHANGED DATECHANGED
IX_SALESORDERMARKETINGSURVEYRESPONSE_SALESORDERID SALESORDERID
PK_SALESORDERMARKETINGSURVEYRESPONSE ID yes yes

Triggers

Trigger Name Description
TR_SALESORDERMARKETINGSURVEYRESPONSE_AUDIT_UPDATE
TR_SALESORDERMARKETINGSURVEYRESPONSE_AUDIT_DELETE