Tables [dbo].[AgentContactPhoneNumber]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created4:03:16 PM Thursday, December 6, 2018
Last Modified4:03:17 PM Thursday, December 6, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_AgentContactPhoneNumber: AgentContactPhoneNumberIDAgentContactPhoneNumberIDint4
No
1 - 1
Foreign Keys FK_AgentContactPhoneNumber_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
AreaCode[dbo].[PhoneAreaCode]4
Yes
LocalNumber[dbo].[PhoneLocalNumber]20
Yes
Extension[dbo].[PhoneExtension]10
Yes
Foreign Keys FK_AgentContactPhoneNumber_AgentContact: [dbo].[AgentContact].AgentContactFIDIndexes IX_AgentContactPhoneNumber_AgentContactAndPhoneType: AgentContactFID\AgentContactPhoneTypeFIDAgentContactFIDint4
No
Foreign Keys FK_AgentContactPhoneNumber_AgentContactPhoneType: [dbo].[AgentContactPhoneType].AgentContactPhoneTypeFIDIndexes IX_AgentContactPhoneNumber_AgentContactAndPhoneType: AgentContactFID\AgentContactPhoneTypeFIDAgentContactPhoneTypeFIDint4
No
Indexes Indexes
NameColumnsUnique
Primary Key PK_AgentContactPhoneNumber: AgentContactPhoneNumberIDPK_AgentContactPhoneNumberAgentContactPhoneNumberID
Yes
IX_AgentContactPhoneNumber_AgentContactAndPhoneTypeAgentContactFID, AgentContactPhoneTypeFID
Yes
Foreign Keys Foreign Keys
NameDeleteColumns
FK_AgentContactPhoneNumber_AgentContactCascadeAgentContactFID->[dbo].[AgentContact].[AgentContactID]
FK_AgentContactPhoneNumber_AgentContactPhoneTypeAgentContactPhoneTypeFID->[dbo].[AgentContactPhoneType].[AgentContactPhoneTypeID]
FK_AgentContactPhoneNumber_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[AgentContactPhoneNumber]
(
[AgentContactPhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[AgentContactFID] [int] NOT NULL,
[AgentContactPhoneTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentContactPhoneNumber] ADD CONSTRAINT [PK_AgentContactPhoneNumber] PRIMARY KEY NONCLUSTERED  ([AgentContactPhoneNumberID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentContactPhoneNumber] ADD CONSTRAINT [IX_AgentContactPhoneNumber_AgentContactAndPhoneType] UNIQUE NONCLUSTERED  ([AgentContactFID], [AgentContactPhoneTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentContactPhoneNumber] ADD CONSTRAINT [FK_AgentContactPhoneNumber_AgentContact] FOREIGN KEY ([AgentContactFID]) REFERENCES [dbo].[AgentContact] ([AgentContactID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[AgentContactPhoneNumber] ADD CONSTRAINT [FK_AgentContactPhoneNumber_AgentContactPhoneType] FOREIGN KEY ([AgentContactPhoneTypeFID]) REFERENCES [dbo].[AgentContactPhoneType] ([AgentContactPhoneTypeID])
GO
ALTER TABLE [dbo].[AgentContactPhoneNumber] ADD CONSTRAINT [FK_AgentContactPhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
GRANT SELECT ON  [dbo].[AgentContactPhoneNumber] TO [MssExec]
GRANT INSERT ON  [dbo].[AgentContactPhoneNumber] TO [MssExec]
GRANT DELETE ON  [dbo].[AgentContactPhoneNumber] TO [MssExec]
GRANT UPDATE ON  [dbo].[AgentContactPhoneNumber] TO [MssExec]
GO
Uses