Tables [dbo].[Serveq]
Properties
PropertyValue
Row Count (~)6092
Created4:57:08 PM Thursday, September 7, 2006
Last Modified8:49:56 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_Serveq: PRIKEYIndexes IX_ServEq_LocServ_ServiceDate: STARTTIME\ENDTIME\EqPriKey\PRIKEY\LSPRIKEYStatistics STAT_ServEq_LocServ_1: LSPRIKEY\PRIKEY\EqPriKeyPRIKEYint4
No
1 - 1
Foreign Keys FK_Serveq_LOCSERV: [dbo].[LocServ].LSPRIKEYIndexes IX_ServEq_LocServ_ServiceDate: STARTTIME\ENDTIME\EqPriKey\PRIKEY\LSPRIKEYIndexes IX_Serveq_LSPRIKEY: LSPRIKEYStatistics STAT_ServEq_LocServ_2: EqPriKey\LSPRIKEYStatistics STAT_ServEq_LocServ_1: LSPRIKEY\PRIKEY\EqPriKeyLSPRIKEYint4
No
Foreign Keys FK_Serveq_EQUIP: [dbo].[Equip].EqPriKeyIndexes IX_Serveq_EqPriKey: EqPriKeyIndexes IX_ServEq_LocServ_ServiceDate: STARTTIME\ENDTIME\EqPriKey\PRIKEY\LSPRIKEYIndexes IX_Serveq_StartTime_EqPriKey: ENDTIME\STARTTIME\EqPriKeyStatistics STAT_ServEq_LocServ_2: EqPriKey\LSPRIKEYStatistics STAT_ServEq_LocServ_1: LSPRIKEY\PRIKEY\EqPriKeyEqPriKeyint4
No
Indexes IX_ServEq_LocServ_ServiceDate: STARTTIME\ENDTIME\EqPriKey\PRIKEY\LSPRIKEYIndexes IX_Serveq_StartTime_EqPriKey: ENDTIME\STARTTIME\EqPriKeySTARTTIMEdatetime8
Yes
Indexes IX_ServEq_LocServ_ServiceDate: STARTTIME\ENDTIME\EqPriKey\PRIKEY\LSPRIKEYIndexes IX_Serveq_StartTime_EqPriKey: ENDTIME\STARTTIME\EqPriKeyENDTIMEdatetime8
Yes
Hourssmallint2
Yes
ActStartTimedatetime8
Yes
ActEndTimedatetime8
Yes
OverTimeStartTimedatetime8
Yes
OverTimeEndTimedatetime8
Yes
DispatchQuantityint4
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_Serveq: PRIKEYPK_ServeqPRIKEY
Yes
80
IX_Serveq_EqPriKeyEqPriKey80
IX_ServEq_LocServ_ServiceDateSTARTTIME, ENDTIME, EqPriKey, PRIKEY, LSPRIKEY80
IX_Serveq_LSPRIKEYLSPRIKEY80
IX_Serveq_StartTime_EqPriKeyENDTIME, STARTTIME, EqPriKey
Statistics Statistics
NameColumns
STAT_ServEq_LocServ_1LSPRIKEY, PRIKEY, EqPriKey
STAT_ServEq_LocServ_2EqPriKey, LSPRIKEY
Check Constraints Check Constraints
NameConstraint
CK_Serveq_QuantityInvalidWhenTimeSet([DispatchQuantity] IS NULL OR [STARTTIME] IS NULL AND [ENDTIME] IS NULL AND [ActStartTime] IS NULL AND [ActEndTime] IS NULL)
Foreign Keys Foreign Keys
NameColumns
FK_Serveq_EQUIPEqPriKey->[dbo].[Equip].[PriKey]
FK_Serveq_LOCSERVLSPRIKEY->[dbo].[LocServ].[PriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[Serveq]
(
[PRIKEY] [int] NOT NULL IDENTITY(1, 1),
[LSPRIKEY] [int] NOT NULL,
[EqPriKey] [int] NOT NULL,
[STARTTIME] [datetime] NULL,
[ENDTIME] [datetime] NULL,
[Hours] [smallint] NULL,
[ActStartTime] [datetime] NULL,
[ActEndTime] [datetime] NULL,
[OverTimeStartTime] [datetime] NULL,
[OverTimeEndTime] [datetime] NULL,
[DispatchQuantity] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Serveq] ADD CONSTRAINT [CK_Serveq_QuantityInvalidWhenTimeSet] CHECK (([DispatchQuantity] IS NULL OR [STARTTIME] IS NULL AND [ENDTIME] IS NULL AND [ActStartTime] IS NULL AND [ActEndTime] IS NULL))
GO
ALTER TABLE [dbo].[Serveq] ADD CONSTRAINT [PK_Serveq] PRIMARY KEY CLUSTERED  ([PRIKEY]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Serveq_EqPriKey] ON [dbo].[Serveq] ([EqPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ServEq_LocServ_ServiceDate] ON [dbo].[Serveq] ([EqPriKey], [PRIKEY], [LSPRIKEY]) INCLUDE ([ENDTIME], [STARTTIME]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Serveq_LSPRIKEY] ON [dbo].[Serveq] ([LSPRIKEY]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Serveq_StartTime_EqPriKey] ON [dbo].[Serveq] ([STARTTIME], [EqPriKey]) INCLUDE ([ENDTIME]) ON [PRIMARY]
GO
CREATE STATISTICS [STAT_ServEq_LocServ_2] ON [dbo].[Serveq] ([EqPriKey], [LSPRIKEY])
GO
CREATE STATISTICS [STAT_ServEq_LocServ_1] ON [dbo].[Serveq] ([LSPRIKEY], [PRIKEY], [EqPriKey])
GO
ALTER TABLE [dbo].[Serveq] ADD CONSTRAINT [FK_Serveq_EQUIP] FOREIGN KEY ([EqPriKey]) REFERENCES [dbo].[Equip] ([PriKey])
GO
ALTER TABLE [dbo].[Serveq] ADD CONSTRAINT [FK_Serveq_LOCSERV] FOREIGN KEY ([LSPRIKEY]) REFERENCES [dbo].[LocServ] ([PriKey])
GO
GRANT SELECT ON  [dbo].[Serveq] TO [MssExec]
GRANT INSERT ON  [dbo].[Serveq] TO [MssExec]
GRANT DELETE ON  [dbo].[Serveq] TO [MssExec]
GRANT UPDATE ON  [dbo].[Serveq] TO [MssExec]
GO
Uses
Used By