CREATE TABLE [dbo].[LaborType]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[LaborType] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsLocalDispatch] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LaborICPriKey] [int] NULL,
[GLNumber] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsLongDistance] [bit] NOT NULL CONSTRAINT [DF_LaborType_IsLongDistance] DEFAULT ((0)),
[AverageHourlyWage] [decimal] (14, 4) NULL,
[IsSystemType] [bit] NOT NULL CONSTRAINT [DF_LaborType_IsSystemType] DEFAULT ((0)),
[IsSalesTeamType] [bit] NOT NULL CONSTRAINT [DF_LaborType_IsSaleTeamType] DEFAULT ((0)),
[CapacityBucketFID] [int] NULL,
[Inactive] [bit] NOT NULL CONSTRAINT [DF_LaborType_Inactive] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LaborType] ADD CONSTRAINT [PK_LaborType] PRIMARY KEY CLUSTERED ([PriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LaborType_CapacityBucketFID] ON [dbo].[LaborType] ([CapacityBucketFID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_LaborType_LaborType] ON [dbo].[LaborType] ([LaborType]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LaborType] ADD CONSTRAINT [FK_LaborType_CapacityBucket] FOREIGN KEY ([CapacityBucketFID]) REFERENCES [dbo].[CapacityBucket] ([CapacityBucketID])
GO
ALTER TABLE [dbo].[LaborType] ADD CONSTRAINT [FK_LaborType_ItemCode] FOREIGN KEY ([LaborICPriKey]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
GRANT SELECT ON [dbo].[LaborType] TO [MssExec]
GRANT INSERT ON [dbo].[LaborType] TO [MssExec]
GRANT DELETE ON [dbo].[LaborType] TO [MssExec]
GRANT UPDATE ON [dbo].[LaborType] TO [MssExec]
GO