Tables [dbo].[OrderContactPhoneNumber]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created8:53:30 AM Friday, December 7, 2018
Last Modified9:02:42 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_OrderContactPhoneNumber: OrderContactPhoneNumberIDOrderContactPhoneNumberIDint4
No
1 - 1
Foreign Keys FK_OrderContactPhoneNumber_OrderContact: [dbo].[OrderContacts].OrderContactFIDIndexes IX_OrderContactPhoneNumber_OrderContactAndPhoneType: OrderContactFID\OrderContactPhoneTypeFIDOrderContactFIDint4
No
Foreign Keys FK_OrderContactPhoneNumber_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
AreaCode[dbo].[PhoneAreaCode]4
Yes
LocalNumber[dbo].[PhoneLocalNumber]20
Yes
Extension[dbo].[PhoneExtension]10
Yes
Foreign Keys FK_OrderContactPhoneNumber_OrderContactPhoneType: [dbo].[OrderContactPhoneType].OrderContactPhoneTypeFIDIndexes IX_OrderContactPhoneNumber_OrderContactAndPhoneType: OrderContactFID\OrderContactPhoneTypeFIDOrderContactPhoneTypeFIDint4
No
Indexes Indexes
NameColumnsUnique
Primary Key PK_OrderContactPhoneNumber: OrderContactPhoneNumberIDPK_OrderContactPhoneNumberOrderContactPhoneNumberID
Yes
IX_OrderContactPhoneNumber_OrderContactAndPhoneTypeOrderContactFID, OrderContactPhoneTypeFID
Yes
Foreign Keys Foreign Keys
NameDeleteColumns
FK_OrderContactPhoneNumber_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
FK_OrderContactPhoneNumber_OrderContactCascadeOrderContactFID->[dbo].[OrderContacts].[OrderContactID]
FK_OrderContactPhoneNumber_OrderContactPhoneTypeOrderContactPhoneTypeFID->[dbo].[OrderContactPhoneType].[OrderContactPhoneTypeID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[OrderContactPhoneNumber]
(
[OrderContactPhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[OrderContactFID] [int] NOT NULL,
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[OrderContactPhoneTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderContactPhoneNumber] ADD CONSTRAINT [PK_OrderContactPhoneNumber] PRIMARY KEY NONCLUSTERED  ([OrderContactPhoneNumberID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderContactPhoneNumber] ADD CONSTRAINT [IX_OrderContactPhoneNumber_OrderContactAndPhoneType] UNIQUE NONCLUSTERED  ([OrderContactFID], [OrderContactPhoneTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderContactPhoneNumber] ADD CONSTRAINT [FK_OrderContactPhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[OrderContactPhoneNumber] ADD CONSTRAINT [FK_OrderContactPhoneNumber_OrderContact] FOREIGN KEY ([OrderContactFID]) REFERENCES [dbo].[OrderContacts] ([OrderContactID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[OrderContactPhoneNumber] ADD CONSTRAINT [FK_OrderContactPhoneNumber_OrderContactPhoneType] FOREIGN KEY ([OrderContactPhoneTypeFID]) REFERENCES [dbo].[OrderContactPhoneType] ([OrderContactPhoneTypeID])
GO
GRANT SELECT ON  [dbo].[OrderContactPhoneNumber] TO [MssExec]
GRANT INSERT ON  [dbo].[OrderContactPhoneNumber] TO [MssExec]
GRANT DELETE ON  [dbo].[OrderContactPhoneNumber] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrderContactPhoneNumber] TO [MssExec]
GO
Uses
Used By