[dbo].[PlasticProviderBranchMapping]
CREATE TABLE [dbo].[PlasticProviderBranchMapping]
(
[ProviderBranchMappingID] [int] NOT NULL IDENTITY(1, 1),
[ProviderFID] [int] NOT NULL,
[BranchFID] [int] NOT NULL,
[ProviderTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticProviderBranchMapping] ADD CONSTRAINT [PK_PlasticProviderBranchMapping] PRIMARY KEY CLUSTERED ([ProviderBranchMappingID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticProviderBranchMapping] ADD CONSTRAINT [IX_PlasticProviderBranchMapping_Branch_Provider] UNIQUE NONCLUSTERED ([BranchFID], [ProviderFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticProviderBranchMapping] ADD CONSTRAINT [IX_PlasticProviderBranchMapping_Provider_Branch] UNIQUE NONCLUSTERED ([ProviderFID], [BranchFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticProviderBranchMapping] ADD CONSTRAINT [IX_PlasticProviderBranchMapping_ProviderType_Branch] UNIQUE NONCLUSTERED ([ProviderTypeFID], [BranchFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PlasticProviderBranchMapping] ADD CONSTRAINT [FK_PlasticProviderBranchMapping_BranchFID] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[PlasticProviderBranchMapping] ADD CONSTRAINT [FK_PlasticProviderBranchMapping_ProviderFID] FOREIGN KEY ([ProviderFID]) REFERENCES [dbo].[PlasticProvider] ([ProviderID])
GO
ALTER TABLE [dbo].[PlasticProviderBranchMapping] ADD CONSTRAINT [FK_PlasticProviderBranchMapping_ProviderTypeFID] FOREIGN KEY ([ProviderTypeFID]) REFERENCES [dbo].[PlasticProviderType] ([ProviderTypeID])
GO
GRANT SELECT ON [dbo].[PlasticProviderBranchMapping] TO [MssExec]
GRANT INSERT ON [dbo].[PlasticProviderBranchMapping] TO [MssExec]
GRANT DELETE ON [dbo].[PlasticProviderBranchMapping] TO [MssExec]
GRANT UPDATE ON [dbo].[PlasticProviderBranchMapping] TO [MssExec]
GO