PROGRAMDOCUMENT

Links a document to a program

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
SEQUENCE int Default = 0 Describes the priority with which the templates will be chosen
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
PROGRAMID uniqueidentifier PROGRAM.ID FK to PROGRAM
DOCUMENTID uniqueidentifier DOCUMENT.ID FK to DOCUMENT
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_PROGRAMDOCUMENT_DATEADDED DATEADDED yes
IX_PROGRAMDOCUMENT_DATECHANGED DATECHANGED
PK_PROGRAMDOCUMENT ID yes yes
UIX_PROGRAMDOCUMENT_PROGRAMID_DOCUMENTID PROGRAMID, DOCUMENTID yes

Triggers

Trigger Name Description
TR_PROGRAMDOCUMENT_AUDIT_UPDATE
TR_PROGRAMDOCUMENT_AUDIT_DELETE