CREATE TABLE [dbo].[LaborTypeBranch]
(
[LaborTypeBranchID] [int] NOT NULL IDENTITY(1, 1),
[LaborTypeFID] [int] NOT NULL,
[BranchFID] [int] NOT NULL,
[AverageHourlyWage] [decimal] (14, 4) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LaborTypeBranch] ADD CONSTRAINT [PK_LaborTypeBranch] PRIMARY KEY CLUSTERED ([LaborTypeBranchID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LaborTypeBranch_Branch] ON [dbo].[LaborTypeBranch] ([BranchFID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_LaborTypeBranch_LaborType_Branch] ON [dbo].[LaborTypeBranch] ([LaborTypeFID], [BranchFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LaborTypeBranch] ADD CONSTRAINT [FK_LaborTypeBranch_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[LaborTypeBranch] ADD CONSTRAINT [FK_LaborTypeBranch_LaborType] FOREIGN KEY ([LaborTypeFID]) REFERENCES [dbo].[LaborType] ([PriKey])
GO
GRANT SELECT ON [dbo].[LaborTypeBranch] TO [MssExec]
GRANT INSERT ON [dbo].[LaborTypeBranch] TO [MssExec]
GRANT DELETE ON [dbo].[LaborTypeBranch] TO [MssExec]
GRANT UPDATE ON [dbo].[LaborTypeBranch] TO [MssExec]
GO