CREATE TABLE [dbo].[ShEntryTypeGroups]
(
[ShEntryTypeGroupID] [int] NOT NULL IDENTITY(1, 1),
[ShTrackingGroupID] [int] NOT NULL,
[ShEntryTypeID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ShEntryTypeGroups] ADD CONSTRAINT [PK_ShEntryTypeGroups] PRIMARY KEY CLUSTERED ([ShEntryTypeGroupID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ShEntryTypeGroups] ADD CONSTRAINT [FK_ShEntryTypeGroups_ShEntryTypeID_ShEntryTypes] FOREIGN KEY ([ShEntryTypeID]) REFERENCES [dbo].[ShEntryTypes] ([ShEntryTypeID])
GO
ALTER TABLE [dbo].[ShEntryTypeGroups] ADD CONSTRAINT [FK_ShEntryTypeGroups_ShTrackingGroupID_ShTrackingGroups] FOREIGN KEY ([ShTrackingGroupID]) REFERENCES [dbo].[ShTrackingGroups] ([ShTrackingGroupID])
GO