CREATE VIEW [dbo].[pal_vEventHistory]
AS
SELECT	E.recId
		,T.name [eventType]
		,E.[subject]
		,E.start startDateTime
		,E.[end] endDateTime
		,S.[status] eventStatus
		,C.contactSurfaceItemId
		,C.isIncluded
FROM	pal_CalendarEvent E
		JOIN pal_CalendarEventType T
			ON T.recId = E.calendarEventTypeId
		JOIN pal_CalendarEventContact C
			ON C.calendarEventId = E.recId
		JOIN pal_CalendarStatus S
			ON S.recId = E.statusId


