Tables [dbo].[AgentAddress]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)5719
Created4:57:07 PM Thursday, September 7, 2006
Last Modified11:13:37 AM Monday, August 19, 2013
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_AgentAddress: AgentAddressIDAgentAddressIDint4
No
1 - 1
Cluster Key IX_AgentAddress_Agent: AgentFID\AddressTypeFIDForeign Keys FK_AgentAddress_Agent: [dbo].[Agent].AgentFIDAgentFIDint4
No
Cluster Key IX_AgentAddress_Agent: AgentFID\AddressTypeFIDForeign Keys FK_AgentAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_AgentAddress_AddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')AddressTypeFIDint4
No
Address1[dbo].[Address]256
Yes
Address2[dbo].[Address]256
Yes
Address3[dbo].[Address]256
Yes
City[dbo].[AddressCity]26
Yes
State[dbo].[AddressState]2
Yes
PostalCode[dbo].[AddressPostalCode]10
Yes
Foreign Keys FK_AgentAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_AgentAddress: AgentAddressIDPK_AgentAddressAgentAddressID
Yes
80
Cluster Key IX_AgentAddress_Agent: AgentFID\AddressTypeFIDIX_AgentAddress_AgentAgentFID, AddressTypeFID
Yes
80
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_AgentAddress_AddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_AgentAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_AgentAddress_AgentCascadeAgentFID->[dbo].[Agent].[AgentPriKey]
FK_AgentAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[AgentAddress]
(
[AgentAddressID] [int] NOT NULL IDENTITY(1, 1),
[AgentFID] [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].[AgentAddress] ADD CONSTRAINT [CK_AgentAddress_AddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[AgentAddress] ADD CONSTRAINT [PK_AgentAddress] PRIMARY KEY NONCLUSTERED  ([AgentAddressID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentAddress] ADD CONSTRAINT [IX_AgentAddress_Agent] UNIQUE CLUSTERED  ([AgentFID], [AddressTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentAddress] ADD CONSTRAINT [FK_AgentAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[AgentAddress] ADD CONSTRAINT [FK_AgentAddress_Agent] FOREIGN KEY ([AgentFID]) REFERENCES [dbo].[Agent] ([AgentPriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[AgentAddress] ADD CONSTRAINT [FK_AgentAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
GRANT SELECT ON  [dbo].[AgentAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[AgentAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[AgentAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[AgentAddress] TO [MssExec]
GO
Uses
Used By