[dbo].[ServTypeClassGLCodeMap]
CREATE TABLE [dbo].[ServTypeClassGLCodeMap]
(
[ServTypeClassGLCodeMapID] [int] NOT NULL IDENTITY(1, 1),
[ServTypeClassFID] [int] NOT NULL,
[AuthorityTypeFID] [int] NULL,
[MoveTypeGroupFID] [int] NULL,
[CommTypeFID] [int] NULL,
[GLCode] [varchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ServTypeClassGLCodeMap] ADD CONSTRAINT [PK_ServTypeClassGLCodeMap] PRIMARY KEY CLUSTERED ([ServTypeClassGLCodeMapID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ServTypeClassGLCodeMap_ServTypeClass_AuthorityType_CommType] ON [dbo].[ServTypeClassGLCodeMap] ([ServTypeClassFID], [AuthorityTypeFID], [CommTypeFID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_ServTypeClassGLCodeMap_ServTypeClass_AuthorityType_MoveTypeGroup_CommType] ON [dbo].[ServTypeClassGLCodeMap] ([ServTypeClassFID], [AuthorityTypeFID], [MoveTypeGroupFID], [CommTypeFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ServTypeClassGLCodeMap_ServTypeClass_CommType] ON [dbo].[ServTypeClassGLCodeMap] ([ServTypeClassFID], [CommTypeFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ServTypeClassGLCodeMap_ServTypeClass_MoveTypeGroup_CommType] ON [dbo].[ServTypeClassGLCodeMap] ([ServTypeClassFID], [MoveTypeGroupFID], [CommTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ServTypeClassGLCodeMap] ADD CONSTRAINT [FK_ServTypeClassGLCodeMap_AuthorityTypes] FOREIGN KEY ([AuthorityTypeFID]) REFERENCES [dbo].[AuthorityTypes] ([AuthPriKey])
GO
ALTER TABLE [dbo].[ServTypeClassGLCodeMap] ADD CONSTRAINT [FK_ServTypeClassGLCodeMap_CommType] FOREIGN KEY ([CommTypeFID]) REFERENCES [dbo].[CommType] ([PriKey])
GO
ALTER TABLE [dbo].[ServTypeClassGLCodeMap] ADD CONSTRAINT [FK_ServTypeClassGLCodeMap_MoveTypeGroups] FOREIGN KEY ([MoveTypeGroupFID]) REFERENCES [dbo].[MoveTypeGroups] ([MTGroupPriKey])
GO
ALTER TABLE [dbo].[ServTypeClassGLCodeMap] ADD CONSTRAINT [FK_ServTypeClassGLCodeMap_ServTypeClass] FOREIGN KEY ([ServTypeClassFID]) REFERENCES [dbo].[ServTypeClass] ([ServTypeClassID])
GO
GRANT SELECT ON [dbo].[ServTypeClassGLCodeMap] TO [MssExec]
GRANT INSERT ON [dbo].[ServTypeClassGLCodeMap] TO [MssExec]
GRANT DELETE ON [dbo].[ServTypeClassGLCodeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[ServTypeClassGLCodeMap] TO [MssExec]
GO