Tables [dbo].[MilitaryBaseAddress]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)201
Created4:57:09 PM Thursday, September 7, 2006
Last Modified11:13:40 AM Monday, August 19, 2013
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_MilitaryBaseAddress: MilitaryBaseAddressIDMilitaryBaseAddressIDint4
No
1 - 1
Foreign Keys FK_MilitaryBaseAddress_MilitaryBase: [dbo].[MilitaryBase].MilitaryBaseFIDIndexes IX_MilitaryBaseAddress_AddressType: MilitaryBaseFID\AddressTypeFIDMilitaryBaseFIDint4
No
Foreign Keys FK_MilitaryBaseAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_MilitaryBaseAddress_AddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')Indexes IX_MilitaryBaseAddress_AddressType: MilitaryBaseFID\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_MilitaryBaseAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_MilitaryBaseAddress: MilitaryBaseAddressIDPK_MilitaryBaseAddressMilitaryBaseAddressID
Yes
80
IX_MilitaryBaseAddress_AddressTypeMilitaryBaseFID, AddressTypeFID
Yes
80
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_MilitaryBaseAddress_AddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_MilitaryBaseAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_MilitaryBaseAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
FK_MilitaryBaseAddress_MilitaryBaseCascadeMilitaryBaseFID->[dbo].[MilitaryBase].[MilitaryBaseID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[MilitaryBaseAddress]
(
[MilitaryBaseAddressID] [int] NOT NULL IDENTITY(1, 1),
[MilitaryBaseFID] [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].[MilitaryBaseAddress] ADD CONSTRAINT [CK_MilitaryBaseAddress_AddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[MilitaryBaseAddress] ADD CONSTRAINT [PK_MilitaryBaseAddress] PRIMARY KEY NONCLUSTERED  ([MilitaryBaseAddressID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseAddress] ADD CONSTRAINT [IX_MilitaryBaseAddress_AddressType] UNIQUE NONCLUSTERED  ([MilitaryBaseFID], [AddressTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryBaseAddress] ADD CONSTRAINT [FK_MilitaryBaseAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[MilitaryBaseAddress] ADD CONSTRAINT [FK_MilitaryBaseAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[MilitaryBaseAddress] ADD CONSTRAINT [FK_MilitaryBaseAddress_MilitaryBase] FOREIGN KEY ([MilitaryBaseFID]) REFERENCES [dbo].[MilitaryBase] ([MilitaryBaseID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[MilitaryBaseAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[MilitaryBaseAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[MilitaryBaseAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[MilitaryBaseAddress] TO [MssExec]
GO
Uses