Tables [dbo].[MilitaryAllocationDetailItem]
Properties
PropertyValue
Row Count (~)0
Created10:30:22 AM Monday, March 30, 2015
Last Modified10:30:29 AM Monday, March 30, 2015
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_MilitaryAllocationDetailItem: MilitaryAllocationDetailItemIDMilitaryAllocationDetailItemIDint4
No
1 - 1
Foreign Keys FK_MilitaryAllocationDetailItem_MilitaryAllocationDetail: [dbo].[MilitaryAllocationDetail].MilitaryAllocationDetailFIDMilitaryAllocationDetailFIDint4
No
Foreign Keys FK_MilitaryAllocationDetailItem_PreferredRevenueAgent: [dbo].[PreferredRevenueAgent].PayAgentFIDPayAgentFIDint4
No
Foreign Keys FK_MilitaryAllocationDetailItem_CalculationType: [dbo].[AllocationCalculationType].CalculationTypeFIDCalculationTypeFIDint4
No
Foreign Keys FK_MilitaryAllocationDetailItem_ItemCode: [dbo].[ItemCode].ItemCodeFIDItemCodeFIDint4
Yes
Percentagefloat8
Yes
Minimumfloat8
Yes
ShareLevelfloat8
Yes
Foreign Keys FK_MilitaryAllocationDetailItem_ReductionTemplateRateLookup: [dbo].[ReductionTemplateRateLookup].ReductionTemplateRateLookupFIDReductionTemplateRateLookupFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_MilitaryAllocationDetailItem: MilitaryAllocationDetailItemIDPK_MilitaryAllocationDetailItemMilitaryAllocationDetailItemID
Yes
Check Constraints Check Constraints
NameConstraint
CK_MilitaryAllocationDetailItem_ValidCalculationType((1)=[dbo].[CheckValidCalculationType]([CalculationTypeFID],[Percentage],[Minimum],[ShareLevel],[ReductionTemplateRateLookupFID]))
Foreign Keys Foreign Keys
NameDeleteColumns
FK_MilitaryAllocationDetailItem_CalculationTypeCalculationTypeFID->[dbo].[AllocationCalculationType].[AllocationCalculationTypeID]
FK_MilitaryAllocationDetailItem_ItemCodeItemCodeFID->[dbo].[ItemCode].[ICPriKey]
FK_MilitaryAllocationDetailItem_MilitaryAllocationDetailCascadeMilitaryAllocationDetailFID->[dbo].[MilitaryAllocationDetail].[MilitaryAllocationDetailID]
FK_MilitaryAllocationDetailItem_PreferredRevenueAgentPayAgentFID->[dbo].[PreferredRevenueAgent].[PreferredRevenueAgentID]
FK_MilitaryAllocationDetailItem_ReductionTemplateRateLookupReductionTemplateRateLookupFID->[dbo].[ReductionTemplateRateLookup].[ReductionTemplateRateLookupID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[MilitaryAllocationDetailItem]
(
[MilitaryAllocationDetailItemID] [int] NOT NULL IDENTITY(1, 1),
[MilitaryAllocationDetailFID] [int] NOT NULL,
[PayAgentFID] [int] NOT NULL,
[CalculationTypeFID] [int] NOT NULL,
[ItemCodeFID] [int] NULL,
[Percentage] [float] NULL,
[Minimum] [float] NULL,
[ShareLevel] [float] NULL,
[ReductionTemplateRateLookupFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryAllocationDetailItem] ADD CONSTRAINT [CK_MilitaryAllocationDetailItem_ValidCalculationType] CHECK (((1)=[dbo].[CheckValidCalculationType]([CalculationTypeFID],[Percentage],[Minimum],[ShareLevel],[ReductionTemplateRateLookupFID])))
GO
ALTER TABLE [dbo].[MilitaryAllocationDetailItem] ADD CONSTRAINT [PK_MilitaryAllocationDetailItem] PRIMARY KEY CLUSTERED  ([MilitaryAllocationDetailItemID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MilitaryAllocationDetailItem] ADD CONSTRAINT [FK_MilitaryAllocationDetailItem_CalculationType] FOREIGN KEY ([CalculationTypeFID]) REFERENCES [dbo].[AllocationCalculationType] ([AllocationCalculationTypeID])
GO
ALTER TABLE [dbo].[MilitaryAllocationDetailItem] ADD CONSTRAINT [FK_MilitaryAllocationDetailItem_ItemCode] FOREIGN KEY ([ItemCodeFID]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
ALTER TABLE [dbo].[MilitaryAllocationDetailItem] ADD CONSTRAINT [FK_MilitaryAllocationDetailItem_MilitaryAllocationDetail] FOREIGN KEY ([MilitaryAllocationDetailFID]) REFERENCES [dbo].[MilitaryAllocationDetail] ([MilitaryAllocationDetailID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[MilitaryAllocationDetailItem] ADD CONSTRAINT [FK_MilitaryAllocationDetailItem_PreferredRevenueAgent] FOREIGN KEY ([PayAgentFID]) REFERENCES [dbo].[PreferredRevenueAgent] ([PreferredRevenueAgentID])
GO
ALTER TABLE [dbo].[MilitaryAllocationDetailItem] ADD CONSTRAINT [FK_MilitaryAllocationDetailItem_ReductionTemplateRateLookup] FOREIGN KEY ([ReductionTemplateRateLookupFID]) REFERENCES [dbo].[ReductionTemplateRateLookup] ([ReductionTemplateRateLookupID])
GO
GRANT SELECT ON  [dbo].[MilitaryAllocationDetailItem] TO [MssExec]
GRANT INSERT ON  [dbo].[MilitaryAllocationDetailItem] TO [MssExec]
GRANT DELETE ON  [dbo].[MilitaryAllocationDetailItem] TO [MssExec]
GRANT UPDATE ON  [dbo].[MilitaryAllocationDetailItem] TO [MssExec]
GO
Uses