[dbo].[XtraStopPhoneNumber]
CREATE TABLE [dbo].[XtraStopPhoneNumber]
(
[XtraStopPhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[XtraStopFID] [int] NOT NULL,
[XtraStopPhoneTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XtraStopPhoneNumber] ADD CONSTRAINT [PK_XtraStopPhoneNumber] PRIMARY KEY NONCLUSTERED ([XtraStopPhoneNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XtraStopPhoneNumber] ADD CONSTRAINT [IX_XtraStopPhoneNumber_XtraStopAndPhoneType] UNIQUE NONCLUSTERED ([XtraStopFID], [XtraStopPhoneTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XtraStopPhoneNumber] ADD CONSTRAINT [FK_XtraStopPhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[XtraStopPhoneNumber] ADD CONSTRAINT [FK_XtraStopPhoneNumber_XtraStop] FOREIGN KEY ([XtraStopFID]) REFERENCES [dbo].[XtraStop] ([PriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XtraStopPhoneNumber] ADD CONSTRAINT [FK_XtraStopPhoneNumber_XtraStopPhoneType] FOREIGN KEY ([XtraStopPhoneTypeFID]) REFERENCES [dbo].[XtraStopPhoneType] ([XtraStopPhoneTypeID])
GO
GRANT SELECT ON [dbo].[XtraStopPhoneNumber] TO [MssExec]
GRANT INSERT ON [dbo].[XtraStopPhoneNumber] TO [MssExec]
GRANT DELETE ON [dbo].[XtraStopPhoneNumber] TO [MssExec]
GRANT UPDATE ON [dbo].[XtraStopPhoneNumber] TO [MssExec]
GO