Tables [dbo].[AccountAddress]
This table is used to store address information for a national account
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)36
Created4:57:07 PM Thursday, September 7, 2006
Last Modified11:13:37 AM Monday, August 19, 2013
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDescription
Cluster Primary Key PK_AccountAddress: AccountAddressIDAccountAddressIDint4
No
1 - 1Primary key of this table
Foreign Keys FK_AccountAddress_Account: [dbo].[Accounts].AccountFIDIndexes IX_AccountAddress_AddressType: AccountFID\AddressTypeFIDAccountFIDint4
No
Key linking this table to a national account record
Foreign Keys FK_AccountAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_AccountAddress_AddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')Indexes IX_AccountAddress_AddressType: AccountFID\AddressTypeFIDAddressTypeFIDint4
No
Key associating a record to a particular address type
Address1[dbo].[Address]256
Yes
First line of the street address for a national account
Address2[dbo].[Address]256
Yes
Second line of the street address for a national account
Address3[dbo].[Address]256
Yes
Third line of the street address for a national account
City[dbo].[AddressCity]26
Yes
City of a national account address
State[dbo].[AddressState]2
Yes
State of a national account address
PostalCode[dbo].[AddressPostalCode]10
Yes
Postal mailing code of a national account
Foreign Keys FK_AccountAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Key associating a record to a country code
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_AccountAddress: AccountAddressIDPK_AccountAddressAccountAddressID
Yes
80
IX_AccountAddress_AddressTypeAccountFID, AddressTypeFID
Yes
80
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_AccountAddress_AddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_AccountAddress_AccountCascadeAccountFID->[dbo].[Accounts].[AccountPriKey]
FK_AccountAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_AccountAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[AccountAddress]
(
[AccountAddressID] [int] NOT NULL IDENTITY(1, 1),
[AccountFID] [int] NOT NULL,
[AddressTypeFID] [int] NOT 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].[AccountAddress] ADD CONSTRAINT [CK_AccountAddress_AddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[AccountAddress] ADD CONSTRAINT [PK_AccountAddress] PRIMARY KEY CLUSTERED  ([AccountAddressID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountAddress] ADD CONSTRAINT [IX_AccountAddress_AddressType] UNIQUE NONCLUSTERED  ([AccountFID], [AddressTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountAddress] ADD CONSTRAINT [FK_AccountAddress_Account] FOREIGN KEY ([AccountFID]) REFERENCES [dbo].[Accounts] ([AccountPriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[AccountAddress] ADD CONSTRAINT [FK_AccountAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[AccountAddress] ADD CONSTRAINT [FK_AccountAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
GRANT SELECT ON  [dbo].[AccountAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[AccountAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[AccountAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[AccountAddress] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'This table is used to store address information for a national account', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key of this table', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'AccountAddressID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key linking this table to a national account record', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'AccountFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'First line of the street address for a national account ', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'Address1'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Second line of the street address for a national account ', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'Address2'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Third line of the street address for a national account ', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', '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'AccountAddress', 'COLUMN', N'AddressTypeFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'City of a national account address', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'City'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Key associating a record to a country code', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'CountryCodeStandardFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Postal mailing code of a national account ', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'PostalCode'
GO
EXEC sp_addextendedproperty N'MS_Description', N'State of a national account address', 'SCHEMA', N'dbo', 'TABLE', N'AccountAddress', 'COLUMN', N'State'
GO
Uses
Used By