Tables [dbo].[AccountPhoneNumber]
This table stores the phone information associated to a national account
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)1
Created4:57:07 PM Thursday, September 7, 2006
Last Modified11:13:37 AM Monday, August 19, 2013
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDescription
Primary Key PK_AccountPhoneNumber: AccountPhoneNumberIDAccountPhoneNumberIDint4
No
1 - 1Primary key of this table
Foreign Keys FK_AccountPhoneNumber_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Key associating a record to a country code
AreaCode[dbo].[PhoneAreaCode]4
Yes
The area code of the phone number for a national account
LocalNumber[dbo].[PhoneLocalNumber]20
Yes
The local phone number for a national account
Extension[dbo].[PhoneExtension]10
Yes
The phone number extension for a contact at the national account
Foreign Keys FK_AccountPhoneNumber_Account: [dbo].[Accounts].AccountFIDIndexes IX_AccountPhoneNumber_Account: AccountFIDAccountFIDint4
No
Key linking this table to a national account record
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_AccountPhoneNumber: AccountPhoneNumberIDPK_AccountPhoneNumberAccountPhoneNumberID
Yes
80
IX_AccountPhoneNumber_AccountAccountFID
Yes
80
Foreign Keys Foreign Keys
NameDeleteColumns
FK_AccountPhoneNumber_AccountCascadeAccountFID->[dbo].[Accounts].[AccountPriKey]
FK_AccountPhoneNumber_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[AccountPhoneNumber]
(
[AccountPhoneNumberID] [int] NOT NULL IDENTITY(1, 1),
[CountryCodeStandardFID] [int] NULL,
[AreaCode] [dbo].[PhoneAreaCode] NULL,
[LocalNumber] [dbo].[PhoneLocalNumber] NULL,
[Extension] [dbo].[PhoneExtension] NULL,
[AccountFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountPhoneNumber] ADD CONSTRAINT [PK_AccountPhoneNumber] PRIMARY KEY NONCLUSTERED  ([AccountPhoneNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountPhoneNumber] ADD CONSTRAINT [IX_AccountPhoneNumber_Account] UNIQUE NONCLUSTERED  ([AccountFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountPhoneNumber] ADD CONSTRAINT [FK_AccountPhoneNumber_Account] FOREIGN KEY ([AccountFID]) REFERENCES [dbo].[Accounts] ([AccountPriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[AccountPhoneNumber] ADD CONSTRAINT [FK_AccountPhoneNumber_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
GRANT SELECT ON  [dbo].[AccountPhoneNumber] TO [MssExec]
GRANT INSERT ON  [dbo].[AccountPhoneNumber] TO [MssExec]
GRANT DELETE ON  [dbo].[AccountPhoneNumber] TO [MssExec]
GRANT UPDATE ON  [dbo].[AccountPhoneNumber] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'This table stores the phone information associated to a national account', 'SCHEMA', N'dbo', 'TABLE', N'AccountPhoneNumber', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key linking this table to a national account record', 'SCHEMA', N'dbo', 'TABLE', N'AccountPhoneNumber', 'COLUMN', N'AccountFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key of this table', 'SCHEMA', N'dbo', 'TABLE', N'AccountPhoneNumber', 'COLUMN', N'AccountPhoneNumberID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The area code of the phone number for a national account', 'SCHEMA', N'dbo', 'TABLE', N'AccountPhoneNumber', 'COLUMN', N'AreaCode'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key associating a record to a country code', 'SCHEMA', N'dbo', 'TABLE', N'AccountPhoneNumber', 'COLUMN', N'CountryCodeStandardFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The phone number extension for a contact at the national account', 'SCHEMA', N'dbo', 'TABLE', N'AccountPhoneNumber', 'COLUMN', N'Extension'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The local phone number for a national account', 'SCHEMA', N'dbo', 'TABLE', N'AccountPhoneNumber', 'COLUMN', N'LocalNumber'
GO
Uses
Used By