Tables [dbo].[LSCrew]
Properties
PropertyValue
Row Count (~)40874
Created12:32:29 PM Monday, August 4, 2014
Last Modified9:41:14 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_LSCrew: PriKeyIndexes IX_LSCrew_LocServ_ServiceDate: StartTime\EndTime\CrewID\PriKey\LSPriKeyStatistics STAT_LSCrew_LocServ_2: CrewID\PriKey\LSPriKeyStatistics STAT_LSCrew_LocServ_1: LSPriKey\PriKeyPriKeyint4
No
1 - 1
Foreign Keys FK_LSCrew_LOCSERV: [dbo].[LocServ].LSPriKeyIndexes IX_LSCrew_LocServ_ServiceDate: StartTime\EndTime\CrewID\PriKey\LSPriKeyIndexes IX_LSCrew_LSPriKey: LSPriKeyStatistics STAT_LSCrew_LocServ_2: CrewID\PriKey\LSPriKeyStatistics STAT_LSCrew_LocServ_1: LSPriKey\PriKeyLSPriKeyint4
No
Foreign Keys FK_LSCrew_Sysuser: [dbo].[Sysuser].CrewIDIndexes IX_LSCrew_CrewID: CrewIDIndexes IX_LSCrew_LocServ_ServiceDate: StartTime\EndTime\CrewID\PriKey\LSPriKeyIndexes IX_LSCrew_StartTime_CrewID: EndTime\StartTime\CrewIDStatistics STAT_LSCrew_LocServ_2: CrewID\PriKey\LSPriKeyCrewIDint4
No
Indexes IX_LSCrew_LocServ_ServiceDate: StartTime\EndTime\CrewID\PriKey\LSPriKeyIndexes IX_LSCrew_StartTime_CrewID: EndTime\StartTime\CrewIDStartTimedatetime8
Yes
Indexes IX_LSCrew_LocServ_ServiceDate: StartTime\EndTime\CrewID\PriKey\LSPriKeyIndexes IX_LSCrew_StartTime_CrewID: EndTime\StartTime\CrewIDEndTimedatetime8
Yes
ActStartdatetime8
Yes
ActEnddatetime8
Yes
LeadManint4
Yes
OverTimeStartdatetime8
Yes
OverTimeEnddatetime8
Yes
Foreign Keys FK_LSCrew_LaborType: [dbo].[LaborType].LaborTypeFIDLaborTypeFIDint4
No
CrewReportTimedatetime8
Yes
Foreign Keys FK_LSCrew_CrewReportLocation: [dbo].[CrewReportLocation].CrewReportLocationFIDCrewReportLocationFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_LSCrew: PriKeyPK_LSCrewPriKey
Yes
IX_LSCrew_CrewIDCrewID
IX_LSCrew_LocServ_ServiceDateStartTime, EndTime, CrewID, PriKey, LSPriKey
IX_LSCrew_LSPriKeyLSPriKey
IX_LSCrew_StartTime_CrewIDEndTime, StartTime, CrewID
Statistics Statistics
NameColumns
STAT_LSCrew_LocServ_1LSPriKey, PriKey
STAT_LSCrew_LocServ_2CrewID, PriKey, LSPriKey
Foreign Keys Foreign Keys
NameColumns
FK_LSCrew_SysuserCrewID->[dbo].[Sysuser].[SysUserID]
FK_LSCrew_CrewReportLocationCrewReportLocationFID->[dbo].[CrewReportLocation].[CrewReportLocationID]
FK_LSCrew_LaborTypeLaborTypeFID->[dbo].[LaborType].[PriKey]
FK_LSCrew_LOCSERVLSPriKey->[dbo].[LocServ].[PriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[LSCrew]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[LSPriKey] [int] NOT NULL,
[CrewID] [int] NOT NULL,
[StartTime] [datetime] NULL,
[EndTime] [datetime] NULL,
[ActStart] [datetime] NULL,
[ActEnd] [datetime] NULL,
[LeadMan] [int] NULL,
[OverTimeStart] [datetime] NULL,
[OverTimeEnd] [datetime] NULL,
[LaborTypeFID] [int] NOT NULL,
[CrewReportTime] [datetime] NULL,
[CrewReportLocationFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LSCrew] ADD CONSTRAINT [PK_LSCrew] PRIMARY KEY CLUSTERED  ([PriKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LSCrew_CrewID] ON [dbo].[LSCrew] ([CrewID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LSCrew_LocServ_ServiceDate] ON [dbo].[LSCrew] ([CrewID], [PriKey], [LSPriKey]) INCLUDE ([EndTime], [StartTime]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LSCrew_LSPriKey] ON [dbo].[LSCrew] ([LSPriKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LSCrew_StartTime_CrewID] ON [dbo].[LSCrew] ([StartTime], [CrewID]) INCLUDE ([EndTime]) ON [PRIMARY]
GO
CREATE STATISTICS [STAT_LSCrew_LocServ_2] ON [dbo].[LSCrew] ([CrewID], [PriKey], [LSPriKey])
GO
CREATE STATISTICS [STAT_LSCrew_LocServ_1] ON [dbo].[LSCrew] ([LSPriKey], [PriKey])
GO
ALTER TABLE [dbo].[LSCrew] ADD CONSTRAINT [FK_LSCrew_Sysuser] FOREIGN KEY ([CrewID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[LSCrew] ADD CONSTRAINT [FK_LSCrew_CrewReportLocation] FOREIGN KEY ([CrewReportLocationFID]) REFERENCES [dbo].[CrewReportLocation] ([CrewReportLocationID])
GO
ALTER TABLE [dbo].[LSCrew] ADD CONSTRAINT [FK_LSCrew_LaborType] FOREIGN KEY ([LaborTypeFID]) REFERENCES [dbo].[LaborType] ([PriKey])
GO
ALTER TABLE [dbo].[LSCrew] ADD CONSTRAINT [FK_LSCrew_LOCSERV] FOREIGN KEY ([LSPriKey]) REFERENCES [dbo].[LocServ] ([PriKey])
GO
GRANT SELECT ON  [dbo].[LSCrew] TO [MssExec]
GRANT INSERT ON  [dbo].[LSCrew] TO [MssExec]
GRANT DELETE ON  [dbo].[LSCrew] TO [MssExec]
GRANT UPDATE ON  [dbo].[LSCrew] TO [MssExec]
GO
Uses
Used By