ITINERARYITEM

This table contains information for an itinerary item.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
STARTTIME UDT_HOURMINUTE Default = '' The start time for this itinerary item.
ENDTIME UDT_HOURMINUTE Default = '' The end time for this itinerary item.
NAME nvarchar(100) Default = '' The name for this itinerary item.
NOTES nvarchar(500) Default = '' The notes for this itinerary item.
BLOCKEVENT bit Default = 0 Indicates whether to block event from other groups.
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.
STARTDATE date The start date for an itinerary item.
ENDDATE date The end date for an itinerary item.
ITEMTYPECODE tinyint Default = 0 The type of itinerary item
ITEMTYPE nvarchar(23) (Computed) yes CASE [ITEMTYPECODE] WHEN 0 THEN N'Scheduled event' WHEN 1 THEN N'Daily admission program' WHEN 2 THEN N'Custom item' WHEN 3 THEN N'Unscheduled item' END Provides a translation for the 'ITEMTYPECODE' field.
INVALIDREASONCODE tinyint Default = 0 For unscheduled items, the reason the item is invalid
INVALIDREASON nvarchar(72) (Computed) yes CASE [INVALIDREASONCODE] WHEN 0 THEN N'Not invalid' WHEN 1 THEN N'Event or program is inactive' WHEN 2 THEN N'Event does not have the capacity for this itinerary' WHEN 3 THEN N'Event is blocked by another itinerary' WHEN 4 THEN N'Event is missing a price type needed by this itinerary' WHEN 5 THEN N'Event not scheduled on this date and time' WHEN 6 THEN N'Daily admission program is inactive' WHEN 8 THEN N'Event is not on sale' WHEN 9 THEN N'Daily admission program is not on sale' WHEN 10 THEN N'Creates resource or location conflict with other event or itinerary item' WHEN 11 THEN N'Daily admission program is missing a price type needed by this itinerary' END Provides a translation for the 'INVALIDREASONCODE' field.
STARTDATETIME datetime (Computed) yes dateadd(minute, convert(tinyint, substring(STARTTIME, 3, 2)), dateadd(hour, convert(tinyint, substring(STARTTIME, 1, 2)), convert(datetime, STARTDATE))) The start date and time of the conflicting event.
ENDDATETIME datetime (Computed) yes dateadd(minute, convert(tinyint, substring(ENDTIME, 3, 2)), dateadd(hour, convert(tinyint, substring(ENDTIME, 1, 2)), convert(datetime, ENDDATE))) The end date and time of the conflicting event.

Foreign Keys

Foreign Key Field Type Null Notes Description
PROGRAMID uniqueidentifier yes PROGRAM.ID The program that is linked to a scheduled or unscheduled Daily admission program itinerary item.
EVENTID uniqueidentifier yes EVENT.ID The event that is linked to a scheduled or unscheduled Daily admission program itinerary item.
ITINERARYID uniqueidentifier ITINERARY.ID The itinerary in which this itinerary item is linked.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
EVENTLOCATIONID uniqueidentifier yes EVENTLOCATION.ID The location for a custom item.

Indexes

Index Name Fields Unique Primary Clustered
IX_ITINERARYITEM_DATEADDED DATEADDED yes
IX_ITINERARYITEM_DATECHANGED DATECHANGED
IX_ITINERARYITEM_EVENTID EVENTID
IX_ITINERARYITEM_EVENTLOCATIONID EVENTLOCATIONID
IX_ITINERARYITEM_ITINERARYID ITINERARYID
IX_ITINERARYITEM_PROGRAMID PROGRAMID
PK_ITINERARYITEM ID yes yes

Triggers

Trigger Name Description
TR_ITINERARYITEM_INSERTUPDATE_ITINERARYSTAFFRESOURCEUPDATE
TR_ITINERARYITEM_DELETE_ITINERARYSTAFFRESOURCEUPDATE
TR_ITINERARYITEM_AUDIT_UPDATE
TR_ITINERARYITEM_AUDIT_DELETE
TR_ITINERARYITEM_UPDATE_ITINERARYITEMSTAFFRESOURCEUPDATE
TR_ITINERARYITEM_INSERT_RESOURCE_UPDATE
TR_ITINERARYITEM_DELETE_RESOURCE_UPDATE

Referenced by

Referenced by Field
ITINERARYITEMLOCATION ID
ITINERARYITEMRESOURCE ITINERARYITEMID
ITINERARYITEMSTAFFRESOURCE ITINERARYITEMID