REGISTRANTROLE

Used to store Participant roles

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
ROLECODE tinyint Default = 0 Role Type
ROLE nvarchar(17) (Computed) yes CASE [ROLECODE] WHEN 0 THEN N'Individual' WHEN 1 THEN N'Team Member' WHEN 2 THEN N'Team Captain' WHEN 3 THEN N'Household Member' WHEN 4 THEN N'Head of Household' WHEN 5 THEN N'Company Leader' END Provides a translation for the 'ROLECODE' field.
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
REGISTRANTID uniqueidentifier REGISTRANT.ID Foreign Key to REGISTRANT table
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_REGISTRANTROLE_DATEADDED DATEADDED yes
IX_REGISTRANTROLE_DATECHANGED DATECHANGED
PK_REGISTRANTROLE ID yes yes
UIX_REGISTRANTROLE_REGISTRANTID_ROLECODE REGISTRANTID, ROLECODE yes

Triggers

Trigger Name Description
TR_REGISTRANTROLE_AUDIT_UPDATE
TR_REGISTRANTROLE_AUDIT_DELETE