Tables [dbo].[StorageItems]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)3060
Created4:57:09 PM Thursday, September 7, 2006
Last Modified8:24:52 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefaultDescription
Primary Key PK_StorageItems: StorageItemsPriKeyStorageItemsPriKeyint4
No
1 - 1Primary key.
Foreign Keys FK_StorageItems_Storage: [dbo].[Storage].StoragePriKeyIndexes IX_StorageItems_StoragePriKey: StoragePriKeyStoragePriKeyint4
No
Foreign key to a storage order.
Foreign Keys FK_StorageItems_StorageItemType: [dbo].[StorageItemType].StorageItemTypePriKeyStorageItemTypePriKeyint4
No
Foreign key to a storage item type.
Descriptionvarchar(128)128
No
Description of the storage item type.
Quantitydecimal(10,4)9
Yes
Quantity of the item.
Ratefloat8
Yes
Rate for the item.
IsManualRatebit1
No
0 if the rate is system calculated. 1 if the rate is manually calculated.
Amountmoney8
No
Amount for the item.
IsManualAmountbit1
No
0 if the Amount is system calculated. 1 if the amount is manually calculated.
Discountdecimal(10,4)9
Yes
Discount used with system calculated amount only.
IsRecurringbit1
No
0 if the item is not billing on a recurring basis. 1 if the item is billing on a recurring basis.
RecurringEndDatedatetime8
Yes
First date the item no longer bills.
Foreign Keys FK_StorageItems_AccountingNote: [dbo].[AccountingNote].ANPriKeyANPriKeyint4
Yes
Foreign key to an accounting note.
Locationvarchar(512)512
Yes
Location or directions to the order in storage.
Foreign Keys FK_StorageItems_Warehouse: [dbo].[Warehouse].WarehousePriKeyWarehousePriKeyint4
No
Foreign key to a warehouse the item is at.
IsFinishedBillingbit1
No
0 if the item should be billed. 1 if the item should no longer be billed.
IsBilledbit1
No
(0)Indicates if the item has been billed or not.
BeginBillingDatedatetime8
Yes
Foreign Keys FK_StorageItems_Division: [dbo].[Division].DivisionFIDDivisionFIDint4
Yes
Quantity2decimal(10,4)9
Yes
Foreign Keys FK_StorageItems_RateType: [dbo].[RateTypes].RateTypeFIDRateTypeFIDint4
Yes
EffectiveDatedatetime8
Yes
Foreign Keys FK_StorageItems_ARBranch: [dbo].[Branch].ARBranchFIDARBranchFIDint4
Yes
Foreign key to the AR branch for the item.
Foreign Keys FK_StorageItems_ARDivision: [dbo].[Division].ARDivisionFIDARDivisionFIDint4
Yes
Foreign key to the division for the item.
Foreign Keys FK_StorageItems_LaborRatingTypeFID: [dbo].[LaborRatingType].LaborRatingTypeFIDLaborRatingTypeFIDint4
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_StorageItems: StorageItemsPriKeyPK_StorageItemsStorageItemsPriKey
Yes
80
IX_StorageItems_StoragePriKeyStoragePriKey80
Foreign Keys Foreign Keys
NameUpdateDeleteColumns
FK_StorageItems_AccountingNoteANPriKey->[dbo].[AccountingNote].[ANPriKey]
FK_StorageItems_ARBranchARBranchFID->[dbo].[Branch].[BranchPriKey]
FK_StorageItems_ARDivisionARDivisionFID->[dbo].[Division].[DivisionID]
FK_StorageItems_DivisionDivisionFID->[dbo].[Division].[DivisionID]
FK_StorageItems_LaborRatingTypeFIDLaborRatingTypeFID->[dbo].[LaborRatingType].[LaborRatingTypeID]
FK_StorageItems_RateTypeRateTypeFID->[dbo].[RateTypes].[RTypePriKey]
FK_StorageItems_StorageItemTypeStorageItemTypePriKey->[dbo].[StorageItemType].[StorageItemTypePriKey]
FK_StorageItems_StorageCascadeCascadeStoragePriKey->[dbo].[Storage].[StoragePriKey]
FK_StorageItems_WarehouseWarehousePriKey->[dbo].[Warehouse].[WarehousePriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[StorageItems]
(
[StorageItemsPriKey] [int] NOT NULL IDENTITY(1, 1),
[StoragePriKey] [int] NOT NULL,
[StorageItemTypePriKey] [int] NOT NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Quantity] [decimal] (10, 4) NULL,
[Rate] [float] NULL,
[IsManualRate] [bit] NOT NULL,
[Amount] [money] NOT NULL,
[IsManualAmount] [bit] NOT NULL,
[Discount] [decimal] (10, 4) NULL,
[IsRecurring] [bit] NOT NULL,
[RecurringEndDate] [datetime] NULL,
[ANPriKey] [int] NULL,
[Location] [varchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[WarehousePriKey] [int] NOT NULL,
[IsFinishedBilling] [bit] NOT NULL,
[IsBilled] [bit] NOT NULL CONSTRAINT [DF_StorageItems_IsBilled] DEFAULT (0),
[BeginBillingDate] [datetime] NULL,
[DivisionFID] [int] NULL,
[Quantity2] [decimal] (10, 4) NULL,
[RateTypeFID] [int] NULL,
[EffectiveDate] [datetime] NULL,
[ARBranchFID] [int] NULL,
[ARDivisionFID] [int] NULL,
[LaborRatingTypeFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [PK_StorageItems] PRIMARY KEY NONCLUSTERED  ([StorageItemsPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StorageItems_StoragePriKey] ON [dbo].[StorageItems] ([StoragePriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_AccountingNote] FOREIGN KEY ([ANPriKey]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_ARBranch] FOREIGN KEY ([ARBranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_ARDivision] FOREIGN KEY ([ARDivisionFID]) REFERENCES [dbo].[Division] ([DivisionID])
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_Division] FOREIGN KEY ([DivisionFID]) REFERENCES [dbo].[Division] ([DivisionID])
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_LaborRatingTypeFID] FOREIGN KEY ([LaborRatingTypeFID]) REFERENCES [dbo].[LaborRatingType] ([LaborRatingTypeID])
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_RateType] FOREIGN KEY ([RateTypeFID]) REFERENCES [dbo].[RateTypes] ([RTypePriKey])
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_StorageItemType] FOREIGN KEY ([StorageItemTypePriKey]) REFERENCES [dbo].[StorageItemType] ([StorageItemTypePriKey])
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_Storage] FOREIGN KEY ([StoragePriKey]) REFERENCES [dbo].[Storage] ([StoragePriKey]) ON DELETE CASCADE ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[StorageItems] ADD CONSTRAINT [FK_StorageItems_Warehouse] FOREIGN KEY ([WarehousePriKey]) REFERENCES [dbo].[Warehouse] ([WarehousePriKey])
GO
GRANT SELECT ON  [dbo].[StorageItems] TO [MssExec]
GRANT INSERT ON  [dbo].[StorageItems] TO [MssExec]
GRANT DELETE ON  [dbo].[StorageItems] TO [MssExec]
GRANT UPDATE ON  [dbo].[StorageItems] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Amount for the item.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'Amount'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to an accounting note.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'ANPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to the AR branch for the item.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'ARBranchFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to the division for the item.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'ARDivisionFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Description of the storage item type.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Discount used with system calculated amount only.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'Discount'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Indicates if the item has been billed or not.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'IsBilled'
GO
EXEC sp_addextendedproperty N'MS_Description', N'0 if the item should be billed. 1 if the item should no longer be billed.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'IsFinishedBilling'
GO
EXEC sp_addextendedproperty N'MS_Description', N'0 if the Amount is system calculated. 1 if the amount is manually calculated.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'IsManualAmount'
GO
EXEC sp_addextendedproperty N'MS_Description', N'0 if the rate is system calculated. 1 if the rate is manually calculated.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'IsManualRate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'0 if the item is not billing on a recurring basis. 1 if the item is billing on a recurring basis.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'IsRecurring'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Location or directions to the order in storage.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Quantity of the item.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'Quantity'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Rate for the item.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'Rate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'First date the item no longer bills.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'RecurringEndDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'StorageItemsPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a storage item type.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'StorageItemTypePriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a storage order.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'StoragePriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a warehouse the item is at.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItems', 'COLUMN', N'WarehousePriKey'
GO
Uses
Used By