﻿CREATE TABLE [dbo].[HIST_LogSummary](
	[No] [bigint] IDENTITY(0,1) NOT NULL,
	[StationName] [nvarchar](128) NULL,
	[TestType] [nvarchar](8) NOT NULL,
	[Version] [nvarchar](4) NOT NULL,
	[ProdCode] [nvarchar](4) NOT NULL,
	[TestListFileNo] [int] NULL,
	[TestListVariantNo] [int] NULL,
	[TestListCntID] [nvarchar](256) NULL,
	[StepVersion] [int] NULL,
	[HostID] [nvarchar](64) NOT NULL,
	[Section] [nvarchar](64) NOT NULL,
	[ProdNo_C] [nvarchar](32) NOT NULL,
	[ProdNo_P] [nvarchar](32) NOT NULL,
	[Testcode] [nvarchar](16) NOT NULL,
	[TestListFileName] [nvarchar](256) NOT NULL,
	[ProductID] [nvarchar](64) NOT NULL,
	[Result] [nvarchar](16) NOT NULL,
	[Duration] [nvarchar](16) NOT NULL,
	[TestDT] [datetime2](7) NOT NULL,
UNIQUE NONCLUSTERED 
(
	[No] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY], 
    CONSTRAINT [PK_HIST_LogSummary] PRIMARY KEY ([No])
) ON [PRIMARY]
GO


GO

ALTER TABLE [dbo].[HIST_LogSummary] ADD  DEFAULT ('-') FOR [StationName]
GO

ALTER TABLE [dbo].[HIST_LogSummary] ADD  DEFAULT ((-1)) FOR [TestListFileNo]
GO

ALTER TABLE [dbo].[HIST_LogSummary] ADD  DEFAULT ((-1)) FOR [TestListVariantNo]
GO

ALTER TABLE [dbo].[HIST_LogSummary] ADD  DEFAULT ((-1)) FOR [StepVersion]
GO

ALTER TABLE [dbo].[HIST_LogSummary] ADD  DEFAULT (getdate()) FOR [TestDT]
GO

CREATE INDEX [HIST_LogSummary_2] ON HIST_LogSummary (TestDT, No);
GO

CREATE INDEX [HIST_LogSummary_3] ON HIST_LogSummary (TestDT);
GO