CREATE TABLE [dbo].[StorePhoneNumber]
(
[StorePhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[StoreFID] [int] NOT NULL,
[StorePhoneTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorePhoneNumber] ADD CONSTRAINT [PK_StorePhoneNumber] PRIMARY KEY CLUSTERED ([StorePhoneNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorePhoneNumber] ADD CONSTRAINT [FK_StorePhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[StorePhoneNumber] ADD CONSTRAINT [FK_StorePhoneNumber_Stores] FOREIGN KEY ([StoreFID]) REFERENCES [dbo].[Stores] ([StoreID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[StorePhoneNumber] ADD CONSTRAINT [FK_StorePhoneNumber_StorePhoneType] FOREIGN KEY ([StorePhoneTypeFID]) REFERENCES [dbo].[StorePhoneType] ([StorePhoneTypeID])
GO
GRANT SELECT ON [dbo].[StorePhoneNumber] TO [MssExec]
GRANT INSERT ON [dbo].[StorePhoneNumber] TO [MssExec]
GRANT DELETE ON [dbo].[StorePhoneNumber] TO [MssExec]
GRANT UPDATE ON [dbo].[StorePhoneNumber] TO [MssExec]
GO