CREATE TABLE [dbo].[grpusg_usages]
(
[usgu_usage_id] [int] NOT NULL,
[usgu_group_code] [dbo].[ais_code_short] NOT NULL,
[usgu_usage_code] [dbo].[ais_code_short] NOT NULL,
[usgu_bm_code] [dbo].[ais_code_short] NOT NULL,
[usgu_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[usgu_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[usgu_l3] [nvarchar] (64) COLLATE French_CI_AS NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[grpusg_usages] ADD 
CONSTRAINT [PK_grpusg_usages] PRIMARY KEY CLUSTERED  ([usgu_usage_id]) ON [PRIMARY]
CREATE UNIQUE NONCLUSTERED INDEX [IX_grpusg_usages] ON [dbo].[grpusg_usages] ([usgu_group_code], [usgu_usage_code]) ON [PRIMARY]




GO

ALTER TABLE [dbo].[grpusg_usages] ADD CONSTRAINT [FK_grpusg_usages_grpusg_bm] FOREIGN KEY ([usgu_bm_code]) REFERENCES [dbo].[grpusg_bm] ([bm_bm_code])
GO
ALTER TABLE [dbo].[grpusg_usages] ADD CONSTRAINT [FK_grpusg_usages_grpusg_groups] FOREIGN KEY ([usgu_group_code]) REFERENCES [dbo].[grpusg_groups] ([usgg_group_code])
GO
