CREATE TABLE [dbo].[EquipBranches]
(
[EquipBranchesPriKey] [int] NOT NULL IDENTITY(1, 1),
[EquipPriKey] [int] NOT NULL,
[BranchPriKey] [int] NOT NULL,
[DefaultBranch] [smallint] NOT NULL CONSTRAINT [DF_EquipBranches_DefaultBranch] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[EquipBranches] ADD CONSTRAINT [PK_EquipBranches] PRIMARY KEY CLUSTERED ([EquipBranchesPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[EquipBranches] ADD CONSTRAINT [FK_EquipBranches_Branch] FOREIGN KEY ([BranchPriKey]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[EquipBranches] ADD CONSTRAINT [FK_EquipBranches_Equip] FOREIGN KEY ([EquipPriKey]) REFERENCES [dbo].[Equip] ([PriKey])
GO
GRANT SELECT ON [dbo].[EquipBranches] TO [MssExec]
GRANT INSERT ON [dbo].[EquipBranches] TO [MssExec]
GRANT DELETE ON [dbo].[EquipBranches] TO [MssExec]
GRANT UPDATE ON [dbo].[EquipBranches] TO [MssExec]
GO