AdventureWorks
| Table Name: | Production.WorkOrderRouting |
| Description: | Work order details. |
| Primary Keys: | WorkOrderID ProductID OperationSequence |
| Field | Type | Defaults | Nulls? | Comments |
|---|---|---|---|---|
| WorkOrderID | int | None | No | Primary key. Foreign key to WorkOrder.WorkOrderID. |
| ProductID | int | None | No | Primary key. Foreign key to Product.ProductID. |
| OperationSequence | smallint | None | No | Primary key. Indicates the manufacturing process sequence. |
| LocationID | smallint | None | No | Manufacturing location where the part is processed. Foreign key to Location.LocationID. |
| ScheduledStartDate | datetime | None | No | Planned manufacturing start date. |
| ScheduledEndDate | datetime | None | No | Planned manufacturing end date. |
| ActualStartDate | datetime | None | Yes | Actual start date. |
| ActualEndDate | datetime | None | Yes | Actual end date. |
| ActualResourceHrs | decimal (9, 4) | None | Yes | Number of manufacturing hours used. |
| PlannedCost | money | None | No | Estimated manufacturing cost. |
| ActualCost | money | None | Yes | Actual manufacturing cost. |
| ModifiedDate | datetime | (getdate()) | No | Date and time the record was last updated. |
| Index | Clustered? | Unique? | Fields |
|---|---|---|---|
| PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence | Yes | Yes | WorkOrderID ProductID OperationSequence |
| IX_WorkOrderRouting_ProductID | No | No | ProductID |
| Check Constraint | Text |
|---|---|
| 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 Constraint | Affected Field | Source Table |
|---|---|---|
| FK_WorkOrderRouting_Location_LocationID | LocationID | Production.Location |
| FK_WorkOrderRouting_WorkOrder_WorkOrderID | WorkOrderID | Production.WorkOrder |