CREATE TABLE [dbo].[grpusg_usages_branches]
(
[usgub_usage_id] [int] NOT NULL,
[usgub_branch_id] [int] NOT NULL,
[usgub_bm_code] [dbo].[ais_code_short] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[grpusg_usages_branches] ADD CONSTRAINT [PK_grpusg_usages_branches] PRIMARY KEY CLUSTERED  ([usgub_usage_id], [usgub_branch_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[grpusg_usages_branches] ADD CONSTRAINT [FK_grpusg_usages_branches_grpusg_bm] FOREIGN KEY ([usgub_bm_code]) REFERENCES [dbo].[grpusg_bm] ([bm_bm_code])
GO
ALTER TABLE [dbo].[grpusg_usages_branches] ADD CONSTRAINT [FK_grpusg_usages_branches_act_branches] FOREIGN KEY ([usgub_branch_id]) REFERENCES [dbo].[act_branches] ([br_actor_id])
GO
ALTER TABLE [dbo].[grpusg_usages_branches] ADD CONSTRAINT [FK_grpusg_usages_branches_grpusg_usages] FOREIGN KEY ([usgub_usage_id]) REFERENCES [dbo].[grpusg_usages] ([usgu_usage_id])
GO
