PDCONSTITUENCYORDER

Stores the hierarchy of constituency codes used to pick a single constituency code for a constituent

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
CONSTITUENCYCODEID uniqueidentifier ID from either CONSTITUENCYCODE or CONSTITUENCYSYSTEMNAME. Comes from V_CONSTITUENCY
SEQUENCE int Default = 0 Order in the constituency code hierarchy
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
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_PDCONSTITUENCYORDER_DATEADDED DATEADDED yes
IX_PDCONSTITUENCYORDER_DATECHANGED DATECHANGED
PK_PDCONSTITUENCYORDER ID yes yes
UIX_PDCONSTITUENCYORDER_CONSTITUENCYCODEID CONSTITUENCYCODEID yes

Triggers

Trigger Name Description
TR_PDCONSTITUENCYORDER_AUDIT_UPDATE
TR_PDCONSTITUENCYORDER_AUDIT_DELETE