Tables [dbo].[StoreAddress]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)241
Created4:57:08 PM Thursday, September 7, 2006
Last Modified11:13:43 AM Monday, August 19, 2013
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_StoreAddress: StoreAddressIDStoreAddressIDint4
No
1 - 1
Foreign Keys FK_StoreAddress_Store: [dbo].[Stores].StoreFIDIndexes IX_StoreAddress_AddressType: StoreFID\AddressTypeFIDStoreFIDint4
No
Foreign Keys FK_StoreAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_StoreAddress_AddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')Indexes IX_StoreAddress_AddressType: StoreFID\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_StoreAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_StoreAddress: StoreAddressIDPK_StoreAddressStoreAddressID
Yes
80
IX_StoreAddress_AddressTypeStoreFID, AddressTypeFID
Yes
80
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_StoreAddress_AddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_StoreAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_StoreAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
FK_StoreAddress_StoreCascadeStoreFID->[dbo].[Stores].[StoreID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[StoreAddress]
(
[StoreAddressID] [int] NOT NULL IDENTITY(1, 1),
[StoreFID] [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].[StoreAddress] ADD CONSTRAINT [CK_StoreAddress_AddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[StoreAddress] ADD CONSTRAINT [PK_StoreAddress] PRIMARY KEY NONCLUSTERED  ([StoreAddressID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StoreAddress] ADD CONSTRAINT [IX_StoreAddress_AddressType] UNIQUE NONCLUSTERED  ([StoreFID], [AddressTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StoreAddress] ADD CONSTRAINT [FK_StoreAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[StoreAddress] ADD CONSTRAINT [FK_StoreAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[StoreAddress] ADD CONSTRAINT [FK_StoreAddress_Store] FOREIGN KEY ([StoreFID]) REFERENCES [dbo].[Stores] ([StoreID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[StoreAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[StoreAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[StoreAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[StoreAddress] TO [MssExec]
GO
Uses
Used By