Tables [dbo].[AccountProfileContactAddress]
This table is used to store address information for contacts of a national account
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created4:57:05 PM Thursday, September 7, 2006
Last Modified11:13:37 AM Monday, August 19, 2013
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDescription
Primary Key PK_AccountProfileContactAddress: AccountProfileContactAddressIDAccountProfileContactAddressIDint4
No
1 - 1Primary key of this table
Foreign Keys FK_AccountProfileContactAddress_AccountProfileContact: [dbo].[AccountProfileContacts].AccountProfileContactFIDIndexes IX_AccountProfileContactAddress_AddressType: AccountProfileContactFID\AddressTypeFIDAccountProfileContactFIDint4
No
Key linking this table to a national account contact record
Foreign Keys FK_AccountProfileContactAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_AccountProfileContactAddress_AddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')Indexes IX_AccountProfileContactAddress_AddressType: AccountProfileContactFID\AddressTypeFIDAddressTypeFIDint4
Yes
Key associating a record to a particular address type
Address1[dbo].[Address]256
Yes
First line of the street address for a national account contact
Address2[dbo].[Address]256
Yes
Second line of the street address for a national account contact
Address3[dbo].[Address]256
Yes
Third line of the street address for a national account contact
City[dbo].[AddressCity]26
Yes
City of a national account address contact
State[dbo].[AddressState]2
Yes
State of a national account address contact
PostalCode[dbo].[AddressPostalCode]10
Yes
Postal mailing code of a national account address contact
Foreign Keys FK_AccountProfileContactAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Key associating a record to a country code
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_AccountProfileContactAddress: AccountProfileContactAddressIDPK_AccountProfileContactAddressAccountProfileContactAddressID
Yes
80
IX_AccountProfileContactAddress_AddressTypeAccountProfileContactFID, AddressTypeFID
Yes
80
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_AccountProfileContactAddress_AddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_AccountProfileContactAddress_AccountProfileContactCascadeAccountProfileContactFID->[dbo].[AccountProfileContacts].[AccountProfileContactID]
FK_AccountProfileContactAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_AccountProfileContactAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[AccountProfileContactAddress]
(
[AccountProfileContactAddressID] [int] NOT NULL IDENTITY(1, 1),
[AccountProfileContactFID] [int] NOT NULL,
[AddressTypeFID] [int] NULL,
[Address1] [dbo].[Address] NULL,
[Address2] [dbo].[Address] NULL,
[Address3] [dbo].[Address] NULL,
[City] [dbo].[AddressCity] NULL,
[State] [dbo].[AddressState] NULL,
[PostalCode] [dbo].[AddressPostalCode] NULL,
[CountryCodeStandardFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountProfileContactAddress] ADD CONSTRAINT [CK_AccountProfileContactAddress_AddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[AccountProfileContactAddress] ADD CONSTRAINT [PK_AccountProfileContactAddress] PRIMARY KEY NONCLUSTERED  ([AccountProfileContactAddressID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountProfileContactAddress] ADD CONSTRAINT [IX_AccountProfileContactAddress_AddressType] UNIQUE NONCLUSTERED  ([AccountProfileContactFID], [AddressTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountProfileContactAddress] ADD CONSTRAINT [FK_AccountProfileContactAddress_AccountProfileContact] FOREIGN KEY ([AccountProfileContactFID]) REFERENCES [dbo].[AccountProfileContacts] ([AccountProfileContactID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[AccountProfileContactAddress] ADD CONSTRAINT [FK_AccountProfileContactAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[AccountProfileContactAddress] ADD CONSTRAINT [FK_AccountProfileContactAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
GRANT SELECT ON  [dbo].[AccountProfileContactAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[AccountProfileContactAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[AccountProfileContactAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[AccountProfileContactAddress] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'This table is used to store address information for contacts of a national account', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key of this table', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'AccountProfileContactAddressID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key linking this table to a national account contact record', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'AccountProfileContactFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'First line of the street address for a national account contact', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'Address1'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Second line of the street address for a national account contact', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'Address2'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Third line of the street address for a national account contact', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'Address3'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key associating a record to a particular address type', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'AddressTypeFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'City of a national account address contact', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'City'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key associating a record to a country code', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'CountryCodeStandardFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Postal mailing code of a national account address contact', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'PostalCode'
GO
EXEC sp_addextendedproperty N'MS_Description', N'State of a national account address contact', 'SCHEMA', N'dbo', 'TABLE', N'AccountProfileContactAddress', 'COLUMN', N'State'
GO
Uses
Used By