Tables [dbo].[OrderContactAddress]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created8:53:30 AM Friday, December 7, 2018
Last Modified9:02:42 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_OrderContactAddress: OrderContactAddressIDOrderContactAddressIDint4
No
1 - 1
Foreign Keys FK_OrderContactAddress_OrderContact: [dbo].[OrderContacts].OrderContactFIDIndexes IX_OrderContactAddress_OrderContactAddressType: OrderContactFID\AddressTypeFIDOrderContactFIDint4
No
Foreign Keys FK_OrderContactAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_OrderContactAddress_MainAddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')Indexes IX_OrderContactAddress_OrderContactAddressType: OrderContactFID\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_OrderContactAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Primary Key PK_OrderContactAddress: OrderContactAddressIDPK_OrderContactAddressOrderContactAddressID
Yes
IX_OrderContactAddress_OrderContactAddressTypeOrderContactFID, AddressTypeFID
Yes
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_OrderContactAddress_MainAddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_OrderContactAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_OrderContactAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
FK_OrderContactAddress_OrderContactCascadeOrderContactFID->[dbo].[OrderContacts].[OrderContactID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[OrderContactAddress]
(
[OrderContactAddressID] [int] NOT NULL IDENTITY(1, 1),
[OrderContactFID] [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].[OrderContactAddress] ADD CONSTRAINT [CK_OrderContactAddress_MainAddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[OrderContactAddress] ADD CONSTRAINT [PK_OrderContactAddress] PRIMARY KEY NONCLUSTERED  ([OrderContactAddressID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderContactAddress] ADD CONSTRAINT [IX_OrderContactAddress_OrderContactAddressType] UNIQUE NONCLUSTERED  ([OrderContactFID], [AddressTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderContactAddress] ADD CONSTRAINT [FK_OrderContactAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[OrderContactAddress] ADD CONSTRAINT [FK_OrderContactAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
ALTER TABLE [dbo].[OrderContactAddress] ADD CONSTRAINT [FK_OrderContactAddress_OrderContact] FOREIGN KEY ([OrderContactFID]) REFERENCES [dbo].[OrderContacts] ([OrderContactID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[OrderContactAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[OrderContactAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[OrderContactAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrderContactAddress] TO [MssExec]
GO
Uses
Used By