AdventureWorks2019
Production.WorkOrderRouting
//
Work order details.
Created: Modified:
Columns
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[smallint] NOT NULL
-
//${escapify(column.description)}[smallint] NOT NULL
-
//${escapify(column.description)}[datetime] NOT NULL
-
//${escapify(column.description)}[datetime] NOT NULL
-
//${escapify(column.description)}[datetime] NULL
-
//${escapify(column.description)}[datetime] NULL
-
//${escapify(column.description)}[decimal](9, 4) NULL//CONSTRAINT: Check constraint [ActualResourceHrs] >= (0.0000)([ActualResourceHrs]>=(0.0000))
-
//${escapify(column.description)}[money] NOT NULL//CONSTRAINT: Check constraint [PlannedCost] > (0.00)([PlannedCost]>(0.00))
-
//${escapify(column.description)}[money] NULL//CONSTRAINT: Check constraint [ActualCost] > (0.00)([ActualCost]>(0.00))
-
//${escapify(column.description)}[datetime] NOT NULL DEFAULT (getdate())
Indexes
-
//Clustered index created by a primary key constraint.PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequenceUNIQUE CLUSTEREDWorkOrderID , ProductID , OperationSequence
-
//Nonclustered index.IX_WorkOrderRouting_ProductIDNONCLUSTEREDProductID
Foreign Keys
-
//Foreign key constraint referencing Location.LocationID.FK_WorkOrderRouting_Location_LocationIDProduction.LocationLocationID ⥱ LocationID
-
//Foreign key constraint referencing WorkOrder.WorkOrderID.FK_WorkOrderRouting_WorkOrder_WorkOrderIDProduction.WorkOrderWorkOrderID ⥱ WorkOrderID
Check Constraints
-
//Check constraint [ActualEndDate] >= [ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULLCK_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