[dbo].[AutoCommissionPreferredAgentMap]
CREATE TABLE [dbo].[AutoCommissionPreferredAgentMap]
(
[AutoCommissionPreferredAgentMapID] [int] NOT NULL IDENTITY(1, 1),
[AutoCommissionOptionsFID] [int] NOT NULL,
[PreferredRevenueAgentFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AutoCommissionPreferredAgentMap] ADD CONSTRAINT [PK_AutoCommissionPreferredAgentMap] PRIMARY KEY NONCLUSTERED ([AutoCommissionPreferredAgentMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AutoCommissionPreferredAgentMap] ADD CONSTRAINT [IX_AutoCommissionPreferredAgentMap_AutoCommissionOptions_PreferredRevenueAgent] UNIQUE NONCLUSTERED ([AutoCommissionOptionsFID], [PreferredRevenueAgentFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AutoCommissionPreferredAgentMap] ADD CONSTRAINT [FK_AutoCommissionPreferredAgentMap_AutoCommissionOptions] FOREIGN KEY ([AutoCommissionOptionsFID]) REFERENCES [dbo].[AutoCommissionOptions] ([AutoCommissionOptionsID])
GO
ALTER TABLE [dbo].[AutoCommissionPreferredAgentMap] ADD CONSTRAINT [FK_AutoCommissionPreferredAgentMap_PreferredRevenueAgent] FOREIGN KEY ([PreferredRevenueAgentFID]) REFERENCES [dbo].[PreferredRevenueAgent] ([PreferredRevenueAgentID])
GO
GRANT SELECT ON [dbo].[AutoCommissionPreferredAgentMap] TO [MssExec]
GRANT INSERT ON [dbo].[AutoCommissionPreferredAgentMap] TO [MssExec]
GRANT DELETE ON [dbo].[AutoCommissionPreferredAgentMap] TO [MssExec]
GRANT UPDATE ON [dbo].[AutoCommissionPreferredAgentMap] TO [MssExec]
GO