Databases > AdventureWorks2019 > Tables > Production.WorkOrderRouting

AdventureWorks2019

Production.WorkOrderRouting

//
Work order details.

Created: Modified:

Columns

  • //
    ${escapify(column.description)}
    WorkOrderID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    ProductID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    OperationSequence
    [smallint] NOT NULL
  • //
    ${escapify(column.description)}
    LocationID
    [smallint] NOT NULL
  • //
    ${escapify(column.description)}
    ScheduledStartDate
    [datetime] NOT NULL
  • //
    ${escapify(column.description)}
    ScheduledEndDate
    [datetime] NOT NULL
  • //
    ${escapify(column.description)}
    ActualStartDate
    [datetime] NULL
  • //
    ${escapify(column.description)}
    ActualEndDate
    [datetime] NULL
  • //
    ${escapify(column.description)}
    ActualResourceHrs
    [decimal](9, 4) NULL
    //
    CONSTRAINT: Check constraint [ActualResourceHrs] >= (0.0000)
    ([ActualResourceHrs]>=(0.0000))
  • //
    ${escapify(column.description)}
    PlannedCost
    [money] NOT NULL
    //
    CONSTRAINT: Check constraint [PlannedCost] > (0.00)
    ([PlannedCost]>(0.00))
  • //
    ${escapify(column.description)}
    ActualCost
    [money] NULL
    //
    CONSTRAINT: Check constraint [ActualCost] > (0.00)
    ([ActualCost]>(0.00))
  • //
    ${escapify(column.description)}
    ModifiedDate
    [datetime] NOT NULL DEFAULT (getdate())

Indexes

  • //
    Clustered index created by a primary key constraint.
    PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence
    UNIQUE CLUSTERED
    WorkOrderID , ProductID , OperationSequence
  • //
    Nonclustered index.
    IX_WorkOrderRouting_ProductID
    NONCLUSTERED
    ProductID

Foreign Keys

  • //
    Foreign key constraint referencing Location.LocationID.
    FK_WorkOrderRouting_Location_LocationID
    Production.Location
    LocationID ⥱ LocationID
  • //
    Foreign key constraint referencing WorkOrder.WorkOrderID.
    FK_WorkOrderRouting_WorkOrder_WorkOrderID
    Production.WorkOrder
    WorkOrderID ⥱ WorkOrderID

Check Constraints

  • //
    Check constraint [ActualEndDate] >= [ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL
    CK_WorkOrderRouting_ActualEndDate
    ([ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL)
  • //
    Check constraint [ScheduledEndDate] >= [ScheduledStartDate]
    CK_WorkOrderRouting_ScheduledEndDate
    ([ScheduledEndDate]>=[ScheduledStartDate])

Sample Data

WorkOrderID
ProductID
OperationSequence
LocationID
ScheduledStartDate
ScheduledEndDate
ActualStartDate
ActualEndDate
ActualResourceHrs
PlannedCost
ActualCost
ModifiedDate
13
747
1
10
4.1
92.25
92.25
13
747
2
20
3.5
87.5
87.5
13
747
3
30
1
14.5
14.5
13
747
4
40
2
31.5
31.5
13
747
6
50
3
36.75
36.75
13
747
7
60
4
49
49
14
748
1
10
4.1
92.25
92.25
14
748
2
20
3.5
87.5
87.5
14
748
3
30
1
14.5
14.5
14
748
5
45
2
36
36
14
748
6
50
3
36.75
36.75
14
748
7
60
4
49
49
15
749
7
60
4
49
49
16
753
7
60
4
49
49
17
754
7
60
4
49
49
18
755
7
60
4
49
49
19
756
7
60
4
49
49
20
758
7
60
4
49
49
21
760
7
60
4
49
49
22
761
7
60
4
49
49
23
762
7
60
4
49
49
24
763
7
60
4
49
49
25
764
7
60
4
49
49
26
765
7
60
4
49
49
27
766
7
60
4
49
49