| Production |
| 04/26/2006 |
| PRIMARY |
| 4184 |
| 1704 |
| 72591 |
| Manufacturing work orders. |
|
|
WorkOrderID |
int |
4 |
|
|
|
|
Primary key for WorkOrder records. |
|
|
ProductID |
int |
4 |
|
|
|
|
Product identification number. Foreign key to Product.ProductID. |
|
|
OrderQty |
int |
4 |
|
|
|
|
Product quantity to build. |
|
|
StockedQty |
int |
4 |
|
|
|
|
Quantity built and put in inventory. |
|
|
ScrappedQty |
smallint |
2 |
|
|
|
|
Quantity that failed inspection. |
|
|
StartDate |
datetime |
8 |
|
|
|
|
Work order start date. |
|
|
EndDate |
datetime |
8 |
|
|
|
|
Work order end date. |
|
|
DueDate |
datetime |
8 |
|
|
|
|
Work order due date. |
|
|
ScrapReasonID |
smallint |
2 |
|
|
|
|
Reason for inspection failure. |
|
|
ModifiedDate |
datetime |
8 |
|
(getdate()) |
|
|
Date and time the record was last updated. |
Total: 10 column(s)
|
WorkOrderID |
1 |
1 |
|
Total: 3 index(es)
Total: 2 trigger(s)
|
CK_WorkOrder_EndDate |
([EndDate]>=[StartDate] OR [EndDate] IS NULL) |
|
CK_WorkOrder_OrderQty |
([OrderQty]>(0)) |
|
CK_WorkOrder_ScrappedQty |
([ScrappedQty]>=(0)) |
Total: 3 constraint(s)
Total: 1 table(s)
Total: 2 table(s)
Total: 8 object(s)
Total: 3 object(s)
CREATE TABLE [WorkOrder] (
[WorkOrderID] [int] IDENTITY (1, 1) NOT NULL ,
[ProductID] [int] NOT NULL ,
[OrderQty] [int] NOT NULL ,
[StockedQty] AS (isnull([OrderQty]-[ScrappedQty],(0))) ,
[ScrappedQty] [smallint] NOT NULL ,
[StartDate] [datetime] NOT NULL ,
[EndDate] [datetime] NULL ,
[DueDate] [datetime] NOT NULL ,
[ScrapReasonID] [smallint] NULL ,
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_WorkOrder_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_WorkOrder_WorkOrderID] PRIMARY KEY CLUSTERED
(
[WorkOrderID]
) ON [PRIMARY] ,
CONSTRAINT [FK_WorkOrder_Product_ProductID] FOREIGN KEY
(
[ProductID]
) REFERENCES [Product] (
[ProductID]
),
CONSTRAINT [FK_WorkOrder_ScrapReason_ScrapReasonID] FOREIGN KEY
(
[ScrapReasonID]
) REFERENCES [ScrapReason] (
[ScrapReasonID]
),
CONSTRAINT [CK_WorkOrder_EndDate] CHECK ([EndDate]>=[StartDate] OR [EndDate] IS NULL),
CONSTRAINT [CK_WorkOrder_OrderQty] CHECK ([OrderQty]>(0)),
CONSTRAINT [CK_WorkOrder_ScrappedQty] CHECK ([ScrappedQty]>=(0))
) ON [PRIMARY]
GO
List of tables