Tables [dbo].[JobCostingItem]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created10:40:25 AM Monday, March 30, 2015
Last Modified9:14:56 AM Friday, December 7, 2018
Columns
NameData TypeMax Length (Bytes)Allow Nulls
Cluster Key IX_JobCostingItem_OrderFID: OrderFIDForeign Keys FK_JobCostingItem_Orders: [dbo].[Orders].OrderFIDOrderFIDint4
No
Datedate3
Yes
Foreign Keys FK_JobCostingItem_ExpenseCategory: [dbo].[ExpenseCategory].ExpenseCategoryFIDExpenseCategoryFIDint4
No
ExpenseTypevarchar(128)128
No
Quantitydecimal(12,2)9
Yes
Costdecimal(12,2)9
No
RatedAmountdecimal(12,2)9
Yes
Foreign Keys FK_JobCostingItem_LocServ: [dbo].[LocServ].LocServFIDLocServFIDint4
Yes
QuantityPerUnitdecimal(12,2)9
Yes
LaborTotalint4
Yes
RatePerHourdecimal(12,2)9
Yes
Foreign Keys FK_JobCostingItem_LaborRatingType: [dbo].[LaborRatingType].LaborRatingTypeFIDLaborRatingTypeFIDint4
Yes
Indexes Indexes
NameColumns
Cluster Key IX_JobCostingItem_OrderFID: OrderFIDIX_JobCostingItem_OrderFIDOrderFID
Foreign Keys Foreign Keys
NameDeleteColumns
FK_JobCostingItem_ExpenseCategoryExpenseCategoryFID->[dbo].[ExpenseCategory].[ExpenseCategoryID]
FK_JobCostingItem_LaborRatingTypeLaborRatingTypeFID->[dbo].[LaborRatingType].[LaborRatingTypeID]
FK_JobCostingItem_LocServSetNullLocServFID->[dbo].[LocServ].[PriKey]
FK_JobCostingItem_OrdersOrderFID->[dbo].[Orders].[PriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[JobCostingItem]
(
[OrderFID] [int] NOT NULL,
[Date] [date] NULL,
[ExpenseCategoryFID] [int] NOT NULL,
[ExpenseType] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Quantity] [decimal] (12, 2) NULL,
[Cost] [decimal] (12, 2) NOT NULL,
[RatedAmount] [decimal] (12, 2) NULL,
[LocServFID] [int] NULL,
[QuantityPerUnit] [decimal] (12, 2) NULL,
[LaborTotal] [int] NULL,
[RatePerHour] [decimal] (12, 2) NULL,
[LaborRatingTypeFID] [int] NULL
) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_JobCostingItem_OrderFID] ON [dbo].[JobCostingItem] ([OrderFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[JobCostingItem] ADD CONSTRAINT [FK_JobCostingItem_ExpenseCategory] FOREIGN KEY ([ExpenseCategoryFID]) REFERENCES [dbo].[ExpenseCategory] ([ExpenseCategoryID])
GO
ALTER TABLE [dbo].[JobCostingItem] ADD CONSTRAINT [FK_JobCostingItem_LaborRatingType] FOREIGN KEY ([LaborRatingTypeFID]) REFERENCES [dbo].[LaborRatingType] ([LaborRatingTypeID])
GO
ALTER TABLE [dbo].[JobCostingItem] ADD CONSTRAINT [FK_JobCostingItem_LocServ] FOREIGN KEY ([LocServFID]) REFERENCES [dbo].[LocServ] ([PriKey]) ON DELETE SET NULL
GO
ALTER TABLE [dbo].[JobCostingItem] ADD CONSTRAINT [FK_JobCostingItem_Orders] FOREIGN KEY ([OrderFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
GRANT SELECT ON  [dbo].[JobCostingItem] TO [MssExec]
GRANT INSERT ON  [dbo].[JobCostingItem] TO [MssExec]
GRANT DELETE ON  [dbo].[JobCostingItem] TO [MssExec]
GRANT UPDATE ON  [dbo].[JobCostingItem] TO [MssExec]
GO
Uses