[dbo].[MilitaryBasePhoneNumber]
CREATE TABLE [dbo].[MilitaryBasePhoneNumber]
(
[MilitaryBasePhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[MilitaryBaseFID] [int] NOT NULL,
[MilitaryBasePhoneTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBasePhoneNumber] ADD CONSTRAINT [PK_MilitaryBasePhoneNumber] PRIMARY KEY NONCLUSTERED ([MilitaryBasePhoneNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBasePhoneNumber] ADD CONSTRAINT [IX_MilitaryBasePhoneNumber_MilitaryBaseAndPhoneType] UNIQUE NONCLUSTERED ([MilitaryBaseFID], [MilitaryBasePhoneTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBasePhoneNumber] ADD CONSTRAINT [FK_MilitaryBasePhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[MilitaryBasePhoneNumber] ADD CONSTRAINT [FK_MilitaryBasePhoneNumber_MilitaryBase] FOREIGN KEY ([MilitaryBaseFID]) REFERENCES [dbo].[MilitaryBase] ([MilitaryBaseID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[MilitaryBasePhoneNumber] ADD CONSTRAINT [FK_MilitaryBasePhoneNumber_MilitaryBasePhoneType] FOREIGN KEY ([MilitaryBasePhoneTypeFID]) REFERENCES [dbo].[MilitaryBasePhoneType] ([MilitaryBasePhoneTypeID])
GO
GRANT SELECT ON [dbo].[MilitaryBasePhoneNumber] TO [MssExec]
GRANT INSERT ON [dbo].[MilitaryBasePhoneNumber] TO [MssExec]
GRANT DELETE ON [dbo].[MilitaryBasePhoneNumber] TO [MssExec]
GRANT UPDATE ON [dbo].[MilitaryBasePhoneNumber] TO [MssExec]
GO