SURVEY

Contains information about surveys.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NAME nvarchar(250) Default = ''
DATESENT datetime yes
DATERESPONDED datetime yes
COMMENT nvarchar(max) Default = ''
BBNCSURVEYID int Default = 0 The ID of the downloaded BBNC survey.
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
SURVEYCATEGORYCODEID uniqueidentifier yes SURVEYCATEGORYCODE.ID FK to SURVEYCATEGORYCODE
CONSTITUENTID uniqueidentifier CONSTITUENT.LOCALID FK to CONSTITUENT
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_SURVEY_CONSTITUENTID CONSTITUENTID
IX_SURVEY_DATEADDED DATEADDED yes
IX_SURVEY_DATECHANGED DATECHANGED
PK_SURVEY ID yes yes

Triggers

Trigger Name Description
TR_SURVEY_AUDIT_UPDATE
TR_SURVEY_AUDIT_DELETE

Referenced by

Referenced by Field
SURVEYATTACHMENT SURVEYID
SURVEYMEDIALINK SURVEYID
SURVEYNOTE SURVEYID
SURVEYRESPONSE SURVEYID