﻿CREATE TABLE [dbo].[LotUsage_Hist]
(
	[UniqueID] BIGINT NOT NULL,
	[WorkOrderNumber] BIGINT NOT NULL, 
    [LotNumber] VARCHAR(30) NOT NULL, 
	[BranchCode] VARCHAR(12) NULL,
    [ShortItemNumber] BIGINT NOT NULL,
	[Quantity] DECIMAL(15, 2) NOT NULL,
    [LastUpdateDT] DATETIME NOT NULL, 
    CONSTRAINT [PK_LotUsage_Hist] PRIMARY KEY CLUSTERED([UniqueID])
)
GO

CREATE INDEX [IX_LotUsage_Hist_WorkOrderNumber] ON [dbo].[LotUsage_Hist] ([WorkOrderNumber])
GO

CREATE INDEX [IX_LotUsage_Hist_LotLookup] ON [dbo].[LotUsage_Hist] ([LotNumber], [ShortItemNumber], [BranchCode])
GO