Tables [dbo].[MobileCrewTime]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created8:49:55 AM Friday, December 7, 2018
Last Modified8:52:53 AM Friday, October 11, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_MobileCrewTime: MobileCrewTimeIDMobileCrewTimeIDbigint8
No
1 - 1
Cluster Key IX_MobileCrewTime_CrewMemberFID_StartTimeUtc: CrewMemberFID\StartTimeUtcForeign Keys FK_MobileCrewTime_CrewMemberFID: [dbo].[Sysuser].CrewMemberFIDIndexes IX_MobileCrewTime_CrewMemberFID_LocServFID: CrewMemberFID\LocServFIDIndexes IX_MobileCrewTime_LocServFID_CrewMemberFID: LocServFID\CrewMemberFIDIndexes IX_MobileCrewTime_StartTimeLocal_CrewMemberFID: StartTimeLocal\CrewMemberFIDCrewMemberFIDint4
No
Foreign Keys FK_MobileCrewTime_LocServFID: [dbo].[LocServ].LocServFIDIndexes IX_MobileCrewTime_CrewMemberFID_LocServFID: CrewMemberFID\LocServFIDIndexes IX_MobileCrewTime_LocServFID_CrewMemberFID: LocServFID\CrewMemberFIDLocServFIDint4
Yes
Foreign Keys FK_MobileCrewTime_MobileCrewTimeActivityFID: [dbo].[MobileCrewTimeActivity].MobileCrewTimeActivityFIDMobileCrewTimeActivityFIDint4
Yes
Cluster Key IX_MobileCrewTime_CrewMemberFID_StartTimeUtc: CrewMemberFID\StartTimeUtcStartTimeUtcdatetime8
No
StartTimeZonesmallint2
No
EndTimeUtcdatetime8
Yes
EndTimeZonesmallint2
Yes
IsApprovedbit1
No
IsOverTimebit1
No
LastCommentvarchar(64)64
Yes
Indexes IX_MobileCrewTime_StartTimeLocal_CrewMemberFID: StartTimeLocal\CrewMemberFIDStartTimeLocaldatetime8
No
GpsLatitudeInfloat8
Yes
GpsLongitudeInfloat8
Yes
GpsLatitudeOutfloat8
Yes
GpsLongitudeOutfloat8
Yes
Indexes Indexes
NameColumnsUnique
Primary Key PK_MobileCrewTime: MobileCrewTimeIDPK_MobileCrewTimeMobileCrewTimeID
Yes
IX_MobileCrewTime_CrewMemberFID_LocServFIDCrewMemberFID, LocServFID
Cluster Key IX_MobileCrewTime_CrewMemberFID_StartTimeUtc: CrewMemberFID\StartTimeUtcIX_MobileCrewTime_CrewMemberFID_StartTimeUtcCrewMemberFID, StartTimeUtc
IX_MobileCrewTime_LocServFID_CrewMemberFIDLocServFID, CrewMemberFID
IX_MobileCrewTime_StartTimeLocal_CrewMemberFIDStartTimeLocal, CrewMemberFID
Check Constraints Check Constraints
NameConstraint
CK_MobileCrewTime_LocServActivity([LocServFID] IS NOT NULL OR [MobileCrewTimeActivityFID] IS NOT NULL)
Foreign Keys Foreign Keys
NameColumns
FK_MobileCrewTime_CrewMemberFIDCrewMemberFID->[dbo].[Sysuser].[SysUserID]
FK_MobileCrewTime_LocServFIDLocServFID->[dbo].[LocServ].[PriKey]
FK_MobileCrewTime_MobileCrewTimeActivityFIDMobileCrewTimeActivityFID->[dbo].[MobileCrewTimeActivity].[MobileCrewTimeActivityID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[MobileCrewTime]
(
[MobileCrewTimeID] [bigint] NOT NULL IDENTITY(1, 1),
[CrewMemberFID] [int] NOT NULL,
[LocServFID] [int] NULL,
[MobileCrewTimeActivityFID] [int] NULL,
[StartTimeUtc] [datetime] NOT NULL,
[StartTimeZone] [smallint] NOT NULL,
[EndTimeUtc] [datetime] NULL,
[EndTimeZone] [smallint] NULL,
[IsApproved] [bit] NOT NULL,
[IsOverTime] [bit] NOT NULL,
[LastComment] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StartTimeLocal] [datetime] NOT NULL,
[GpsLatitudeIn] [float] NULL,
[GpsLongitudeIn] [float] NULL,
[GpsLatitudeOut] [float] NULL,
[GpsLongitudeOut] [float] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MobileCrewTime] ADD CONSTRAINT [CK_MobileCrewTime_LocServActivity] CHECK (([LocServFID] IS NOT NULL OR [MobileCrewTimeActivityFID] IS NOT NULL))
GO
ALTER TABLE [dbo].[MobileCrewTime] ADD CONSTRAINT [PK_MobileCrewTime] PRIMARY KEY NONCLUSTERED  ([MobileCrewTimeID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_MobileCrewTime_CrewMemberFID_LocServFID] ON [dbo].[MobileCrewTime] ([CrewMemberFID], [LocServFID]) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_MobileCrewTime_CrewMemberFID_StartTimeUtc] ON [dbo].[MobileCrewTime] ([CrewMemberFID], [StartTimeUtc]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_MobileCrewTime_LocServFID_CrewMemberFID] ON [dbo].[MobileCrewTime] ([LocServFID], [CrewMemberFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_MobileCrewTime_StartTimeLocal_CrewMemberFID] ON [dbo].[MobileCrewTime] ([StartTimeLocal], [CrewMemberFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MobileCrewTime] ADD CONSTRAINT [FK_MobileCrewTime_CrewMemberFID] FOREIGN KEY ([CrewMemberFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[MobileCrewTime] ADD CONSTRAINT [FK_MobileCrewTime_LocServFID] FOREIGN KEY ([LocServFID]) REFERENCES [dbo].[LocServ] ([PriKey])
GO
ALTER TABLE [dbo].[MobileCrewTime] ADD CONSTRAINT [FK_MobileCrewTime_MobileCrewTimeActivityFID] FOREIGN KEY ([MobileCrewTimeActivityFID]) REFERENCES [dbo].[MobileCrewTimeActivity] ([MobileCrewTimeActivityID])
GO
GRANT SELECT ON  [dbo].[MobileCrewTime] TO [MssExec]
GRANT INSERT ON  [dbo].[MobileCrewTime] TO [MssExec]
GRANT DELETE ON  [dbo].[MobileCrewTime] TO [MssExec]
GRANT UPDATE ON  [dbo].[MobileCrewTime] TO [MssExec]
GO
Uses
Used By