﻿CREATE TABLE [dbo].[WorkOrderTime_Hist] (
     [UniqueID] BIGINT NOT NULL,
     [WorkOrderNumber] BIGINT NOT NULL,
     [StepNumber] DECIMAL(7, 2) NOT NULL,
	 [WorkCenterCode] VARCHAR(12) NOT NULL,
	 [BranchCode] VARCHAR(12) NOT NULL, 
	 [AddressNumber] BIGINT NOT NULL,
	 [GlDate] DATETIME NULL,
	 [LastUpdateDT] DATETIME NOT NULL, 
     CONSTRAINT [PK_WorkOrderTime_Hist] PRIMARY KEY CLUSTERED([UniqueID])
)

GO

CREATE INDEX [IX_WorkOrderTime_Hist_Lookup] ON [dbo].[WorkOrderTime_Hist] ([WorkOrderNumber], [WorkCenterCode], [StepNumber])

GO

CREATE INDEX [IX_WorkOrderTime_Hist_AddressNumber] ON [dbo].[WorkOrderTime_Hist] ([AddressNumber]) INCLUDE([WorkOrderNumber], [WorkCenterCode], [StepNumber], [LastUpdateDT])

GO