[dbo].[MilitaryBaseState]
CREATE TABLE [dbo].[MilitaryBaseState]
(
[MilitaryBaseStateID] [int] NOT NULL IDENTITY(1, 1),
[MilitaryBaseFID] [int] NOT NULL,
[StateFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseState] ADD CONSTRAINT [PK_MilitaryBaseState] PRIMARY KEY CLUSTERED ([MilitaryBaseStateID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseState] ADD CONSTRAINT [IX_MilitaryBaseState_MilitaryBaseAndState] UNIQUE NONCLUSTERED ([MilitaryBaseFID], [StateFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseState] ADD CONSTRAINT [FK_MilitaryBaseState_MilitaryBase] FOREIGN KEY ([MilitaryBaseFID]) REFERENCES [dbo].[MilitaryBase] ([MilitaryBaseID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[MilitaryBaseState] ADD CONSTRAINT [FK_MilitaryBaseState_State] FOREIGN KEY ([StateFID]) REFERENCES [dbo].[State] ([StateID])
GO
GRANT SELECT ON [dbo].[MilitaryBaseState] TO [MssExec]
GRANT INSERT ON [dbo].[MilitaryBaseState] TO [MssExec]
GRANT DELETE ON [dbo].[MilitaryBaseState] TO [MssExec]
GRANT UPDATE ON [dbo].[MilitaryBaseState] TO [MssExec]
GO