[dbo].[MilitaryAllocationAgent]
CREATE TABLE [dbo].[MilitaryAllocationAgent]
(
[MilitaryAllocationAgentID] [int] NOT NULL IDENTITY(1, 1),
[MilitaryAllocationHeaderFID] [int] NOT NULL,
[AgentFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryAllocationAgent] ADD CONSTRAINT [PK_MilitaryAllocationAgent] PRIMARY KEY CLUSTERED ([MilitaryAllocationAgentID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryAllocationAgent] ADD CONSTRAINT [IX_MilitaryAllocationAgent_MilitaryAllocationHeader_Agent] UNIQUE NONCLUSTERED ([MilitaryAllocationHeaderFID], [AgentFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryAllocationAgent] ADD CONSTRAINT [FK_MilitaryAllocationAgent_Agent] FOREIGN KEY ([AgentFID]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
ALTER TABLE [dbo].[MilitaryAllocationAgent] ADD CONSTRAINT [FK_MilitaryAllocationAgent_MilitaryAllocationHeader] FOREIGN KEY ([MilitaryAllocationHeaderFID]) REFERENCES [dbo].[MilitaryAllocationHeader] ([MilitaryAllocationHeaderID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[MilitaryAllocationAgent] TO [MssExec]
GRANT INSERT ON [dbo].[MilitaryAllocationAgent] TO [MssExec]
GRANT DELETE ON [dbo].[MilitaryAllocationAgent] TO [MssExec]
GRANT UPDATE ON [dbo].[MilitaryAllocationAgent] TO [MssExec]
GO