﻿CREATE TABLE [dbo].[WorkOrder_Curr]
(
	[WorkOrderNumber] BIGINT NOT NULL, 
	[BranchCode] VARCHAR(12) NULL,
    [LotNumber] VARCHAR(30) NULL,
	[ItemNumber] VARCHAR(25) NULL, 
	[ShortItemNumber] BIGINT NOT NULL,
    [ParentWorkOrderNumber] VARCHAR(8) NULL, 
    [OrderQuantity] DECIMAL(15, 2) NOT NULL, 
    [HeldQuantity] DECIMAL(15, 2) NOT NULL, 
    [ShippedQuantity] DECIMAL(15, 2) NOT NULL, 
    [StatusCode] VARCHAR(10) NULL, 
    [StatusCodeUpdateDT] DATETIME NULL,
	[IssueDate] DATETIME NOT NULL,
	[StartDate] DATETIME NOT NULL ,
	[RoutingType] VARCHAR(3) NULL,
	[LastUpdateDT] DATETIME NOT NULL, 
	CONSTRAINT [PK_WorkOrder_Curr] PRIMARY KEY CLUSTERED([WorkOrderNumber])
)
GO

CREATE INDEX [IX_WorkOrder_Curr_ParentWorkOrderNumber] ON [dbo].[WorkOrder_Curr] ([ParentWorkOrderNumber])
GO

CREATE INDEX [IX_WorkOrder_Curr_ItemNumber] ON [dbo].[WorkOrder_Curr] ([ItemNumber])
GO
