[dbo].[MilitaryBaseContactPhoneNumber]
CREATE TABLE [dbo].[MilitaryBaseContactPhoneNumber]
(
[MilitaryBaseContactPhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[MilitaryBaseContactFID] [int] NOT NULL,
[MilitaryBaseContactPhoneTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseContactPhoneNumber] ADD CONSTRAINT [PK_MilitaryBaseContactPhoneNumber] PRIMARY KEY NONCLUSTERED ([MilitaryBaseContactPhoneNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseContactPhoneNumber] ADD CONSTRAINT [IX_MilitaryBaseContactPhoneNumber_MilitaryBaseContactAndPhoneType] UNIQUE NONCLUSTERED ([MilitaryBaseContactFID], [MilitaryBaseContactPhoneTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseContactPhoneNumber] ADD CONSTRAINT [FK_MilitaryBaseContactPhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[MilitaryBaseContactPhoneNumber] ADD CONSTRAINT [FK_MilitaryBaseContactPhoneNumber_MilitaryBaseContact] FOREIGN KEY ([MilitaryBaseContactFID]) REFERENCES [dbo].[MilitaryBaseContact] ([MilitaryBaseContactID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[MilitaryBaseContactPhoneNumber] ADD CONSTRAINT [FK_MilitaryBaseContactPhoneNumber_MilitaryBaseContactPhoneType] FOREIGN KEY ([MilitaryBaseContactPhoneTypeFID]) REFERENCES [dbo].[MilitaryBaseContactPhoneType] ([MilitaryBaseContactPhoneTypeID])
GO
GRANT SELECT ON [dbo].[MilitaryBaseContactPhoneNumber] TO [MssExec]
GRANT INSERT ON [dbo].[MilitaryBaseContactPhoneNumber] TO [MssExec]
GRANT DELETE ON [dbo].[MilitaryBaseContactPhoneNumber] TO [MssExec]
GRANT UPDATE ON [dbo].[MilitaryBaseContactPhoneNumber] TO [MssExec]
GO