CREATE TABLE [dbo].[ClaimPhoneNumber]
(
[ClaimPhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[ClaimFID] [int] NOT NULL,
[ClaimPhoneTypeFID] [int] NOT NULL,
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimPhoneNumber] ADD CONSTRAINT [PK_ClaimPhoneNumber] PRIMARY KEY NONCLUSTERED ([ClaimPhoneNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimPhoneNumber] ADD CONSTRAINT [IX_ClaimPhoneNumber_ClaimAndPhoneType] UNIQUE NONCLUSTERED ([ClaimFID], [ClaimPhoneTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimPhoneNumber] ADD CONSTRAINT [FK_ClaimPhoneNumber_Claim] FOREIGN KEY ([ClaimFID]) REFERENCES [dbo].[Claim] ([ClaimID])
GO
ALTER TABLE [dbo].[ClaimPhoneNumber] ADD CONSTRAINT [FK_ClaimPhoneNumber_ClaimPhoneType] FOREIGN KEY ([ClaimPhoneTypeFID]) REFERENCES [dbo].[ClaimPhoneType] ([ClaimPhoneTypeID])
GO
ALTER TABLE [dbo].[ClaimPhoneNumber] ADD CONSTRAINT [FK_ClaimPhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
GRANT SELECT ON [dbo].[ClaimPhoneNumber] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimPhoneNumber] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimPhoneNumber] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimPhoneNumber] TO [MssExec]
GO