Properties

Owner: Production 
Creation Date: 04/26/2006 
Located On: PRIMARY 
Data Size KB: 5544 
Index Size KB: 912 
Rows: 67131 
Description: Work order details. 

Columns

Name Data Type Length NULL Default IsIdentity IsGUID Description
    WorkOrderID  int          Primary key. Foreign key to WorkOrder.WorkOrderID. 
    ProductID  int          Primary key. Foreign key to Product.ProductID. 
    OperationSequence  smallint          Primary key. Indicates the manufacturing process sequence. 
    LocationID  smallint          Manufacturing location where the part is processed. Foreign key to Location.LocationID. 
    ScheduledStartDate  datetime          Planned manufacturing start date. 
    ScheduledEndDate  datetime          Planned manufacturing end date. 
    ActualStartDate  datetime          Actual start date. 
    ActualEndDate  datetime          Actual end date. 
    ActualResourceHrs  decimal          Number of manufacturing hours used. 
    PlannedCost  money          Estimated manufacturing cost. 
    ActualCost  money          Actual manufacturing cost. 
    ModifiedDate  datetime    (getdate())      Date and time the record was last updated. 
Total: 12 column(s)

Indexes

Index Primary Unique Description
  PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence      Primary key (clustered) constraint 
  IX_WorkOrderRouting_ProductID      Nonclustered index. 
Total: 2 index(es)

Check Constraints

Name Expression
  CK_WorkOrderRouting_ActualCost  ([ActualCost]>(0.00)) 
  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_ScheduledEndDate  ([ScheduledEndDate]>=[ScheduledStartDate]) 
Total: 5 constraint(s)

Referenced Tables

Table Foreign Key Primary Key or Unique Constraint
  Production.Location  FK_WorkOrderRouting_Location_LocationID  PK_Location_LocationID 
  Production.WorkOrder  FK_WorkOrderRouting_WorkOrder_WorkOrderID  PK_WorkOrder_WorkOrderID 
Total: 2 table(s)

Objects that [Production].[WorkOrderRouting] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  Location  Production  Table 
  ProductCategory  Production  Table 
  ProductModel  Production  Table 
  ScrapReason  Production  Table 
  UnitMeasure  Production  Table 
  ProductSubcategory  Production  Table 
  Product  Production  Table 
  WorkOrder  Production  Table 
Total: 10 object(s)

SQL

CREATE TABLE [WorkOrderRouting] (
    [WorkOrderID] [int] NOT NULL ,
    [ProductID] [int] NOT NULL ,
    [OperationSequence] [smallint] NOT NULL ,
    [LocationID] [smallint] NOT NULL ,
    [ScheduledStartDate] [datetime] NOT NULL ,
    [ScheduledEndDate] [datetime] NOT NULL ,
    [ActualStartDate] [datetime] NULL ,
    [ActualEndDate] [datetime] NULL ,
    [ActualResourceHrs] [decimal](9, 4) NULL ,
    [PlannedCost] [money] NOT NULL ,
    [ActualCost] [money] NULL ,
    [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_WorkOrderRouting_ModifiedDate] DEFAULT (getdate()),
    CONSTRAINT [PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence] PRIMARY KEY  CLUSTERED
    (
        [WorkOrderID],
        [ProductID],
        [OperationSequence]
    )  ON [PRIMARY] ,
    CONSTRAINT [FK_WorkOrderRouting_Location_LocationID] FOREIGN KEY
    (
        [LocationID]
    ) REFERENCES [Location] (
        [LocationID]
    ),
    CONSTRAINT [FK_WorkOrderRouting_WorkOrder_WorkOrderID] FOREIGN KEY
    (
        [WorkOrderID]
    ) REFERENCES [WorkOrder] (
        [WorkOrderID]
    ),
    CONSTRAINT [CK_WorkOrderRouting_ActualCost] CHECK ([ActualCost]>(0.00)),
    CONSTRAINT [CK_WorkOrderRouting_ActualEndDate] CHECK ([ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL),
    CONSTRAINT [CK_WorkOrderRouting_ActualResourceHrs] CHECK ([ActualResourceHrs]>=(0.0000)),
    CONSTRAINT [CK_WorkOrderRouting_PlannedCost] CHECK ([PlannedCost]>(0.00)),
    CONSTRAINT [CK_WorkOrderRouting_ScheduledEndDate] CHECK ([ScheduledEndDate]>=[ScheduledStartDate])
) ON [PRIMARY]
GO


See Also

List of tables