[dbo].[ManufacturerPhoneNumber]
CREATE TABLE [dbo].[ManufacturerPhoneNumber]
(
[ManufacturerPhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[ManufacturerFID] [int] NOT NULL,
[ManufacturerPhoneTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ManufacturerPhoneNumber] ADD CONSTRAINT [PK_ManufacturerPhoneNumber] PRIMARY KEY NONCLUSTERED ([ManufacturerPhoneNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ManufacturerPhoneNumber] ADD CONSTRAINT [IX_ManufacturerPhoneNumber_ManufacturerAndPhoneType] UNIQUE NONCLUSTERED ([ManufacturerFID], [ManufacturerPhoneTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ManufacturerPhoneNumber] ADD CONSTRAINT [FK_ManufacturerPhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[ManufacturerPhoneNumber] ADD CONSTRAINT [FK_ManufacturerPhoneNumber_Manufacturers] FOREIGN KEY ([ManufacturerFID]) REFERENCES [dbo].[Manufacturer] ([ManufacturerID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ManufacturerPhoneNumber] ADD CONSTRAINT [FK_ManufacturerPhoneNumber_ManufacturerPhoneType] FOREIGN KEY ([ManufacturerPhoneTypeFID]) REFERENCES [dbo].[ManufacturerPhoneType] ([ManufacturerPhoneTypeID])
GO
GRANT SELECT ON [dbo].[ManufacturerPhoneNumber] TO [MssExec]
GRANT INSERT ON [dbo].[ManufacturerPhoneNumber] TO [MssExec]
GRANT DELETE ON [dbo].[ManufacturerPhoneNumber] TO [MssExec]
GRANT UPDATE ON [dbo].[ManufacturerPhoneNumber] TO [MssExec]
GO