Tables [dbo].[LaborRatingScheduleQuery]
Properties
PropertyValue
Row Count (~)18
Created8:34:14 AM Friday, December 7, 2018
Last Modified8:34:30 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_LaborRatingScheduleQuery: LaborRatingScheduleQueryIDLaborRatingScheduleQueryIDint4
No
1 - 1
Cluster Key IX_LaborRatingScheduleQuery_LaborRatingGroupFID_LaborRatingDayFID_StartTime: LaborRatingGroupFID\LaborRatingDayFID\StartTimeForeign Keys FK_LaborRatingScheduleQuery_LaborRatingGroup: [dbo].[LaborRatingGroup].LaborRatingGroupFIDLaborRatingGroupFIDint4
No
Cluster Key IX_LaborRatingScheduleQuery_LaborRatingGroupFID_LaborRatingDayFID_StartTime: LaborRatingGroupFID\LaborRatingDayFID\StartTimeForeign Keys FK_LaborRatingScheduleQuery_LaborRatingDay: [dbo].[LaborRatingDay].LaborRatingDayFIDLaborRatingDayFIDint4
No
Cluster Key IX_LaborRatingScheduleQuery_LaborRatingGroupFID_LaborRatingDayFID_StartTime: LaborRatingGroupFID\LaborRatingDayFID\StartTimeStartTimedatetime8
No
EndTimedatetime8
No
Foreign Keys FK_LaborRatingScheduleQuery_LaborRatingTypeFID: [dbo].[LaborRatingType].LaborRatingTypeFIDLaborRatingTypeFIDint4
No
Indexes Indexes
NameColumnsUnique
Primary Key PK_LaborRatingScheduleQuery: LaborRatingScheduleQueryIDPK_LaborRatingScheduleQueryLaborRatingScheduleQueryID
Yes
Cluster Key IX_LaborRatingScheduleQuery_LaborRatingGroupFID_LaborRatingDayFID_StartTime: LaborRatingGroupFID\LaborRatingDayFID\StartTimeIX_LaborRatingScheduleQuery_LaborRatingGroupFID_LaborRatingDayFID_StartTimeLaborRatingGroupFID, LaborRatingDayFID, StartTime
Yes
Check Constraints Check Constraints
NameConstraint
CK_LaborRatingScheduleQuery_StartTime_EndTime((1)=[dbo].[IsOnDayZero]([StartTime]) AND (1)=[dbo].[IsOnDayZero]([EndTime]))
Foreign Keys Foreign Keys
NameDeleteColumns
FK_LaborRatingScheduleQuery_LaborRatingDayLaborRatingDayFID->[dbo].[LaborRatingDay].[LaborRatingDayID]
FK_LaborRatingScheduleQuery_LaborRatingGroupCascadeLaborRatingGroupFID->[dbo].[LaborRatingGroup].[LaborRatingGroupID]
FK_LaborRatingScheduleQuery_LaborRatingTypeFIDLaborRatingTypeFID->[dbo].[LaborRatingType].[LaborRatingTypeID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[LaborRatingScheduleQuery]
(
[LaborRatingScheduleQueryID] [int] NOT NULL IDENTITY(1, 1),
[LaborRatingGroupFID] [int] NOT NULL,
[LaborRatingDayFID] [int] NOT NULL,
[StartTime] [datetime] NOT NULL,
[EndTime] [datetime] NOT NULL,
[LaborRatingTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LaborRatingScheduleQuery] ADD CONSTRAINT [CK_LaborRatingScheduleQuery_StartTime_EndTime] CHECK (((1)=[dbo].[IsOnDayZero]([StartTime]) AND (1)=[dbo].[IsOnDayZero]([EndTime])))
GO
ALTER TABLE [dbo].[LaborRatingScheduleQuery] ADD CONSTRAINT [PK_LaborRatingScheduleQuery] PRIMARY KEY NONCLUSTERED  ([LaborRatingScheduleQueryID]) ON [PRIMARY]
GO
CREATE UNIQUE CLUSTERED INDEX [IX_LaborRatingScheduleQuery_LaborRatingGroupFID_LaborRatingDayFID_StartTime] ON [dbo].[LaborRatingScheduleQuery] ([LaborRatingGroupFID], [LaborRatingDayFID], [StartTime]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LaborRatingScheduleQuery] ADD CONSTRAINT [FK_LaborRatingScheduleQuery_LaborRatingDay] FOREIGN KEY ([LaborRatingDayFID]) REFERENCES [dbo].[LaborRatingDay] ([LaborRatingDayID])
GO
ALTER TABLE [dbo].[LaborRatingScheduleQuery] ADD CONSTRAINT [FK_LaborRatingScheduleQuery_LaborRatingGroup] FOREIGN KEY ([LaborRatingGroupFID]) REFERENCES [dbo].[LaborRatingGroup] ([LaborRatingGroupID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[LaborRatingScheduleQuery] ADD CONSTRAINT [FK_LaborRatingScheduleQuery_LaborRatingTypeFID] FOREIGN KEY ([LaborRatingTypeFID]) REFERENCES [dbo].[LaborRatingType] ([LaborRatingTypeID])
GO
GRANT SELECT ON  [dbo].[LaborRatingScheduleQuery] TO [MssExec]
GRANT INSERT ON  [dbo].[LaborRatingScheduleQuery] TO [MssExec]
GRANT DELETE ON  [dbo].[LaborRatingScheduleQuery] TO [MssExec]
GRANT UPDATE ON  [dbo].[LaborRatingScheduleQuery] TO [MssExec]
GO
Uses