SURVEYATTACHMENT

This table contains attachments belonging to survey.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DATEENTERED datetime The date that the attachment was entered
TITLE nvarchar(50) Default = '' The title of the attachment.
FILE varbinary The actual file for the attachment.
FILENAME nvarchar(255) Default = '' The original file name for the attachment.
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
AUTHORID uniqueidentifier yes CONSTITUENT.LOCALID The author of the attachment.
SURVEYATTACHMENTTYPECODEID uniqueidentifier SURVEYATTACHMENTTYPECODE.ID Indicates the user-defined type of this attachment.
SURVEYID uniqueidentifier SURVEY.ID The survey record to which this attachment belongs.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_SURVEYATTACHMENT_AUTHORID AUTHORID
IX_SURVEYATTACHMENT_DATEADDED DATEADDED yes
IX_SURVEYATTACHMENT_DATECHANGED DATECHANGED
IX_SURVEYATTACHMENT_SURVEYID SURVEYID
PK_SURVEYATTACHMENT ID yes yes

Triggers

Trigger Name Description
TR_SURVEYATTACHMENT_AUDIT_UPDATE
TR_SURVEYATTACHMENT_AUDIT_DELETE