Tables [dbo].[OrderLocationAddress]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created8:53:30 AM Friday, December 7, 2018
Last Modified9:14:56 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_OrderLocationAddress: OrderLocationAddressIDOrderLocationAddressIDint4
No
1 - 1
Foreign Keys FK_OrderLocationAddress_OrderLocation: [dbo].[OrderLocations].OrderLocationFIDIndexes ix_OrderLocationAddress_OrderLocation: OrderLocationFIDOrderLocationFIDint4
No
Foreign Keys FK_OrderLocationAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_OrderLocationAddress_MainAddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')AddressTypeFIDint4
No
Foreign Keys FK_OrderLocationAddress_AddressLocationType: [dbo].[AddressLocationType].AddressLocationTypeFIDAddressLocationTypeFIDint4
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_OrderLocationAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Primary Key PK_OrderLocationAddress: OrderLocationAddressIDPK_OrderLocationAddressOrderLocationAddressID
Yes
ix_OrderLocationAddress_OrderLocationOrderLocationFID
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_OrderLocationAddress_MainAddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_OrderLocationAddress_AddressLocationTypeAddressLocationTypeFID->[dbo].[AddressLocationType].[AddressLocationTypeID]
FK_OrderLocationAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_OrderLocationAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
FK_OrderLocationAddress_OrderLocationCascadeOrderLocationFID->[dbo].[OrderLocations].[OrderLocationID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[OrderLocationAddress]
(
[OrderLocationAddressID] [int] NOT NULL IDENTITY(1, 1),
[OrderLocationFID] [int] NOT NULL,
[AddressTypeFID] [int] NOT NULL,
[AddressLocationTypeFID] [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].[OrderLocationAddress] ADD CONSTRAINT [CK_OrderLocationAddress_MainAddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[OrderLocationAddress] ADD CONSTRAINT [PK_OrderLocationAddress] PRIMARY KEY NONCLUSTERED  ([OrderLocationAddressID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [ix_OrderLocationAddress_OrderLocation] ON [dbo].[OrderLocationAddress] ([OrderLocationFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderLocationAddress] ADD CONSTRAINT [FK_OrderLocationAddress_AddressLocationType] FOREIGN KEY ([AddressLocationTypeFID]) REFERENCES [dbo].[AddressLocationType] ([AddressLocationTypeID])
GO
ALTER TABLE [dbo].[OrderLocationAddress] ADD CONSTRAINT [FK_OrderLocationAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[OrderLocationAddress] ADD CONSTRAINT [FK_OrderLocationAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[OrderLocationAddress] ADD CONSTRAINT [FK_OrderLocationAddress_OrderLocation] FOREIGN KEY ([OrderLocationFID]) REFERENCES [dbo].[OrderLocations] ([OrderLocationID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[OrderLocationAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[OrderLocationAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[OrderLocationAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrderLocationAddress] TO [MssExec]
GO
Uses
Used By