[dbo].[BranchLocationMap]
CREATE TABLE [dbo].[BranchLocationMap]
(
[BranchLocationMapID] [int] NOT NULL IDENTITY(1, 1),
[BranchFID] [int] NOT NULL,
[BranchLocationFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BranchLocationMap] ADD CONSTRAINT [PK_BranchLocationMap] PRIMARY KEY CLUSTERED ([BranchLocationMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BranchLocationMap] ADD CONSTRAINT [IX_BranchLocationMap_Branch] UNIQUE NONCLUSTERED ([BranchFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BranchLocationMap] ADD CONSTRAINT [FK_BranchLocationMap_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BranchLocationMap] ADD CONSTRAINT [FK_BranchLocationMap_BranchLocation] FOREIGN KEY ([BranchLocationFID]) REFERENCES [dbo].[BranchLocation] ([BranchLocationID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[BranchLocationMap] TO [MssExec]
GRANT INSERT ON [dbo].[BranchLocationMap] TO [MssExec]
GRANT DELETE ON [dbo].[BranchLocationMap] TO [MssExec]
GRANT UPDATE ON [dbo].[BranchLocationMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key linking this table to a particular branch.', 'SCHEMA', N'dbo', 'TABLE', N'BranchLocationMap', 'COLUMN', N'BranchFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key linking this table to a particular branch location.', 'SCHEMA', N'dbo', 'TABLE', N'BranchLocationMap', 'COLUMN', N'BranchLocationFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The primary key.', 'SCHEMA', N'dbo', 'TABLE', N'BranchLocationMap', 'COLUMN', N'BranchLocationMapID'
GO