SCHEDULEDATE

Date for a scheduled day in a school

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DATE date Date of the schedule day.
INSESSION bit Default = 1 Indicated whether a date is in session
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.
DAYCOUNT int Default = 0 Value of day in session for a given session

Foreign Keys

Foreign Key Field Type Null Notes Description
SCHOOLID uniqueidentifier SCHOOL.ID The term that the date is related to.
TIMETABLEDAYID uniqueidentifier yes TIMETABLEDAY.ID The timetable day assigned to the date.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_SCHEDULEDATE_DATEADDED DATEADDED yes
IX_SCHEDULEDATE_DATECHANGED DATECHANGED
PK_SCHEDULEDATE ID yes yes
UIX_SCHEDULEDATE_SCHOOLID_DATE SCHOOLID, DATE yes

Triggers

Trigger Name Description
TR_SCHEDULEDATE_AUDIT_UPDATE
TR_SCHEDULEDATE_AUDIT_DELETE