Tables [dbo].[MilitaryBaseContactAddress]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created4:57:09 PM Thursday, September 7, 2006
Last Modified7:32:45 PM Tuesday, September 24, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_MilitaryBaseContactAddress: MilitaryBaseContactAddressIDMilitaryBaseContactAddressIDint4
No
1 - 1
Foreign Keys FK_MilitaryBaseContactAddress_MilitaryBaseContact: [dbo].[MilitaryBaseContact].MilitaryBaseContactFIDIndexes IX_MilitaryBaseContactAddress_AddressType: MilitaryBaseContactFID\AddressTypeFIDMilitaryBaseContactFIDint4
No
Foreign Keys FK_MilitaryBaseContactAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_MilitaryBaseContactAddress_AddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')Indexes IX_MilitaryBaseContactAddress_AddressType: MilitaryBaseContactFID\AddressTypeFIDAddressTypeFIDint4
Yes
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_MilitaryBaseContactAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_MilitaryBaseContactAddress: MilitaryBaseContactAddressIDPK_MilitaryBaseContactAddressMilitaryBaseContactAddressID
Yes
80
IX_MilitaryBaseContactAddress_AddressTypeMilitaryBaseContactFID, AddressTypeFID
Yes
80
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_MilitaryBaseContactAddress_AddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_MilitaryBaseContactAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_MilitaryBaseContactAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
FK_MilitaryBaseContactAddress_MilitaryBaseContactCascadeMilitaryBaseContactFID->[dbo].[MilitaryBaseContact].[MilitaryBaseContactID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[MilitaryBaseContactAddress]
(
[MilitaryBaseContactAddressID] [int] NOT NULL IDENTITY(1, 1),
[MilitaryBaseContactFID] [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].[MilitaryBaseContactAddress] ADD CONSTRAINT [CK_MilitaryBaseContactAddress_AddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[MilitaryBaseContactAddress] ADD CONSTRAINT [PK_MilitaryBaseContactAddress] PRIMARY KEY NONCLUSTERED  ([MilitaryBaseContactAddressID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseContactAddress] ADD CONSTRAINT [IX_MilitaryBaseContactAddress_AddressType] UNIQUE NONCLUSTERED  ([MilitaryBaseContactFID], [AddressTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseContactAddress] ADD CONSTRAINT [FK_MilitaryBaseContactAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[MilitaryBaseContactAddress] ADD CONSTRAINT [FK_MilitaryBaseContactAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[MilitaryBaseContactAddress] ADD CONSTRAINT [FK_MilitaryBaseContactAddress_MilitaryBaseContact] FOREIGN KEY ([MilitaryBaseContactFID]) REFERENCES [dbo].[MilitaryBaseContact] ([MilitaryBaseContactID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[MilitaryBaseContactAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[MilitaryBaseContactAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[MilitaryBaseContactAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[MilitaryBaseContactAddress] TO [MssExec]
GO
Uses