AdventureWorks

Basic Index   Expanded Index

Table Name:Production.WorkOrderRouting
Description:Work order details.
Primary Keys:WorkOrderID
ProductID
OperationSequence
FieldTypeDefaultsNulls?Comments
WorkOrderIDintNoneNoPrimary key. Foreign key to WorkOrder.WorkOrderID.
ProductIDintNoneNoPrimary key. Foreign key to Product.ProductID.
OperationSequencesmallintNoneNoPrimary key. Indicates the manufacturing process sequence.
LocationIDsmallintNoneNoManufacturing location where the part is processed. Foreign key to Location.LocationID.
ScheduledStartDatedatetimeNoneNoPlanned manufacturing start date.
ScheduledEndDatedatetimeNoneNoPlanned manufacturing end date.
ActualStartDatedatetimeNoneYesActual start date.
ActualEndDatedatetimeNoneYesActual end date.
ActualResourceHrsdecimal (9, 4)NoneYesNumber of manufacturing hours used.
PlannedCostmoneyNoneNoEstimated manufacturing cost.
ActualCostmoneyNoneYesActual manufacturing cost.
ModifiedDatedatetime(getdate())NoDate and time the record was last updated.

IndexClustered?Unique?Fields
PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceYesYesWorkOrderID
ProductID
OperationSequence
IX_WorkOrderRouting_ProductIDNoNoProductID

Check ConstraintText
CK_WorkOrderRouting_ScheduledEndDate([ScheduledEndDate]>=[ScheduledStartDate])
CK_WorkOrderRouting_ActualEndDate([ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL)
CK_WorkOrderRouting_ActualResourceHrs([ActualResourceHrs]>=(0.0000))
CK_WorkOrderRouting_PlannedCost([PlannedCost]>(0.00))
CK_WorkOrderRouting_ActualCost([ActualCost]>(0.00))

Internal Foreign Key ConstraintAffected FieldSource Table
FK_WorkOrderRouting_Location_LocationIDLocationIDProduction.Location
FK_WorkOrderRouting_WorkOrder_WorkOrderIDWorkOrderIDProduction.WorkOrder

No primary keys as foreign key constraints
No triggers