CONTROLACCOUNTELEMENT

This table stores all the elements used for control accounts

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
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
CONTROLACCOUNTID uniqueidentifier CONTROLACCOUNT.ID Control account ID
DATAELEMENTID uniqueidentifier PDACCOUNTSEGMENTVALUE.ID Specific item ID
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_CONTROLACCOUNTELEMENT_CONTROLACCOUNTID CONTROLACCOUNTID
IX_CONTROLACCOUNTELEMENT_DATEADDED DATEADDED yes
IX_CONTROLACCOUNTELEMENT_DATECHANGED DATECHANGED
PK_CONTROLACCOUNTELEMENT ID yes yes

Triggers

Trigger Name Description
TR_CONTROLACCOUNTELEMENT_AUDIT_UPDATE
TR_CONTROLACCOUNTELEMENT_AUDIT_DELETE