Tables [dbo].[AccountProfilePresetAddress]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created8:20:47 AM Friday, December 7, 2018
Last Modified8:20:48 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_AccountProfilePresetAddress: AccountProfilePresetAddressIDAccountProfilePresetAddressIDint4
No
1 - 1
Foreign Keys FK_AccountProfilePresetAddress_AccountProfilePreset: [dbo].[AccountProfilePreset].AccountProfilePresetFIDIndexes IX_AccountProfilePresetAddress_AccountProfilePresetFID: AccountProfilePresetFIDIndexes IX_AccountProfilePresetAddress_AddressType: AccountProfilePresetFID\AddressTypeFIDAccountProfilePresetFIDint4
No
Foreign Keys FK_AccountProfilePresetAddress_AddressType: [dbo].[AddressType].AddressTypeFIDCheck Constraints CK_AccountProfilePresetAddress_AddressType : ([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')Indexes IX_AccountProfilePresetAddress_AddressType: AccountProfilePresetFID\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_AccountProfilePresetAddress_CountryCodeStandard: [dbo].[CountryCodeStandard].CountryCodeStandardFIDCountryCodeStandardFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Primary Key PK_AccountProfilePresetAddress: AccountProfilePresetAddressIDPK_AccountProfilePresetAddressAccountProfilePresetAddressID
Yes
IX_AccountProfilePresetAddress_AccountProfilePresetFIDAccountProfilePresetFID
Yes
IX_AccountProfilePresetAddress_AddressTypeAccountProfilePresetFID, AddressTypeFID
Yes
Check Constraints Check Constraints
NameOn ColumnConstraint
CK_AccountProfilePresetAddress_AddressTypeAddressTypeFID([dbo].[GetAddressTypeName]([AddressTypeFID])='Main')
Foreign Keys Foreign Keys
NameDeleteColumns
FK_AccountProfilePresetAddress_AccountProfilePresetCascadeAccountProfilePresetFID->[dbo].[AccountProfilePreset].[AccountProfilePresetID]
FK_AccountProfilePresetAddress_AddressTypeAddressTypeFID->[dbo].[AddressType].[AddressTypeID]
FK_AccountProfilePresetAddress_CountryCodeStandardCountryCodeStandardFID->[dbo].[CountryCodeStandard].[CountryCodeStandardID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[AccountProfilePresetAddress]
(
[AccountProfilePresetAddressID] [int] NOT NULL IDENTITY(1, 1),
[AccountProfilePresetFID] [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].[AccountProfilePresetAddress] ADD CONSTRAINT [CK_AccountProfilePresetAddress_AddressType] CHECK (([dbo].[GetAddressTypeName]([AddressTypeFID])='Main'))
GO
ALTER TABLE [dbo].[AccountProfilePresetAddress] ADD CONSTRAINT [PK_AccountProfilePresetAddress] PRIMARY KEY NONCLUSTERED  ([AccountProfilePresetAddressID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountProfilePresetAddress] ADD CONSTRAINT [IX_AccountProfilePresetAddress_AddressType] UNIQUE NONCLUSTERED  ([AccountProfilePresetFID], [AddressTypeFID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_AccountProfilePresetAddress_AccountProfilePresetFID] ON [dbo].[AccountProfilePresetAddress] ([AccountProfilePresetFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccountProfilePresetAddress] ADD CONSTRAINT [FK_AccountProfilePresetAddress_AccountProfilePreset] FOREIGN KEY ([AccountProfilePresetFID]) REFERENCES [dbo].[AccountProfilePreset] ([AccountProfilePresetID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[AccountProfilePresetAddress] ADD CONSTRAINT [FK_AccountProfilePresetAddress_AddressType] FOREIGN KEY ([AddressTypeFID]) REFERENCES [dbo].[AddressType] ([AddressTypeID])
GO
ALTER TABLE [dbo].[AccountProfilePresetAddress] ADD CONSTRAINT [FK_AccountProfilePresetAddress_CountryCodeStandard] FOREIGN KEY ([CountryCodeStandardFID]) REFERENCES [dbo].[CountryCodeStandard] ([CountryCodeStandardID])
GO
GRANT SELECT ON  [dbo].[AccountProfilePresetAddress] TO [MssExec]
GRANT INSERT ON  [dbo].[AccountProfilePresetAddress] TO [MssExec]
GRANT DELETE ON  [dbo].[AccountProfilePresetAddress] TO [MssExec]
GRANT UPDATE ON  [dbo].[AccountProfilePresetAddress] TO [MssExec]
GO
Uses