[dbo].[LocalServicesCrew]
SET QUOTED_IDENTIFIER OFF
GO
CREATE view [dbo].[LocalServicesCrew]
(
LocalServicesCrewLSCrewFID,
LocalServicesCrewLocServFID,
CrewFirstName,
CrewLastName,
LeadMan,
ScheduledStartTime,
ScheduledEndTime,
ActualStartTime,
ActualEndTime,
ActualIsOverTime
)
with SCHEMABINDING
as
select distinct
LocalServiceCrewLSCrewFID = LSCrew.PriKey,
LocalServiceLocServFID = LSCrew.LSPriKey,
CrewFirstName = SysUser.FirstName,
CrewLastName = SysUser.LastName,
LeadMan = LSCrew.LeadMan,
ScheduledStartTime = LSCrew.StartTime,
ScheduledEndTime = LSCrew.EndTime,
ActualStartTime = LSCrewTimes.StartTime,
ActualEndTime = LSCrewTimes.EndTime,
ActualIsOverTime = LSCrewTimes.OverTime
from dbo.LSCrew
left outer join dbo.SysUser on ( SysUser.SysUserID = LSCrew.CrewID )
left outer join dbo.LSCrewTimes on ( LSCrewTimes.LSCPriKey = LSCrew.PriKey )
GO
GRANT SELECT ON [dbo].[LocalServicesCrew] TO [MssExec]
GRANT INSERT ON [dbo].[LocalServicesCrew] TO [MssExec]
GRANT DELETE ON [dbo].[LocalServicesCrew] TO [MssExec]
GRANT UPDATE ON [dbo].[LocalServicesCrew] TO [MssExec]
GO