[dbo].[LocalServicesEquipment]
SET QUOTED_IDENTIFIER OFF
GO
CREATE view [dbo].[LocalServicesEquipment]
(
LocalServicesEquipmentServeqFID,
LocalServicesEquipmentLocServFID,
Equipment,
EquipmentNumber,
EquipmentType,
EquipmentStatus,
ScheduledStart,
ScheduledEnd,
ActualStartTime,
ActualEndTime,
ActualIsOverTime
)
with SCHEMABINDING
as
select distinct
LocalServicesEquipmentServeqFID = Serveq.PriKey,
LocalServicesEquipmentLocServFID = Serveq.LSPriKey,
Equipment = Equip.Descrip,
EquipmentNumber = Equip.EqNo,
EquipmentType = EqType.Type,
EquipmentStatus = EqStatus.Status,
ScheduledStart = Serveq.StartTime,
ScheduledEnd = Serveq.EndTime,
ActualStartTime = ServeqTimes.StartTime,
ActualEndTime = ServeqTimes.EndTime,
ActualIsOverTime = ServeqTimes.OverTime
from dbo.Serveq
left outer join dbo.Equip on ( Equip.PriKey = Serveq.EqPriKey )
left outer join dbo.EqType on ( EqType.TypeNumber = Equip.Type )
left outer join dbo.EqStatus on ( EqStatus.StatusNo = Equip.EqStatus )
left outer join dbo.ServeqTimes on ( ServeqTimes.SeqPriKey = Serveq.PriKey )
GO
GRANT SELECT ON [dbo].[LocalServicesEquipment] TO [MssExec]
GRANT INSERT ON [dbo].[LocalServicesEquipment] TO [MssExec]
GRANT DELETE ON [dbo].[LocalServicesEquipment] TO [MssExec]
GRANT UPDATE ON [dbo].[LocalServicesEquipment] TO [MssExec]
GO