if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BiasReading_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[BiasReading] DROP CONSTRAINT BiasReading_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CustomerPart_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[CustomerPart] DROP CONSTRAINT CustomerPart_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Users_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Users] DROP CONSTRAINT Users_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GRRReading_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[GRRReading] DROP CONSTRAINT GRRReading_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryJobParameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[HistoryJobParameter] DROP CONSTRAINT HistoryJobParameter_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryWoQapParameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[HistoryWoQapParameter] DROP CONSTRAINT HistoryWoQapParameter_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryWoQapProcess_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[HistoryWoQapProcess] DROP CONSTRAINT HistoryWoQapProcess_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BiasMapping_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[BiasMapping] DROP CONSTRAINT BiasMapping_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GRRMapping_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[GRRMapping] DROP CONSTRAINT GRRMapping_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityMappingMaster_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[LinearityMappingMaster] DROP CONSTRAINT LinearityMappingMaster_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[StabilityMapping_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[StabilityMapping] DROP CONSTRAINT StabilityMapping_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Instrument_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Instrument] DROP CONSTRAINT Instrument_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[JobParameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[JobParameter] DROP CONSTRAINT JobParameter_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[NonConformities_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[NonConformities] DROP CONSTRAINT NonConformities_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityReading_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[LinearityReading] DROP CONSTRAINT LinearityReading_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityMappingDetail_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[LinearityMappingDetail] DROP CONSTRAINT LinearityMappingDetail_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Instrument_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Instrument] DROP CONSTRAINT Instrument_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MachineOperation_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[MachineOperation] DROP CONSTRAINT MachineOperation_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelShiftTarget_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelShiftTarget] DROP CONSTRAINT ModelShiftTarget_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartMachine_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[PartMachine] DROP CONSTRAINT PartMachine_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelToolLife_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelToolLife] DROP CONSTRAINT ModelToolLife_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelToolLinkRange_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelToolLinkRange] DROP CONSTRAINT ModelToolLinkRange_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Machine_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Machine] DROP CONSTRAINT Machine_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OperationToolLinkParamete_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[OperationToolLinkParameter] DROP CONSTRAINT OperationToolLinkParamete_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelToolLinkRange_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelToolLinkRange] DROP CONSTRAINT ModelToolLinkRange_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolTypeParameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ToolTypeParameter] DROP CONSTRAINT ToolTypeParameter_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Parameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Parameter] DROP CONSTRAINT Parameter_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BiasMapping_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[BiasMapping] DROP CONSTRAINT BiasMapping_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CustomerPart_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[CustomerPart] DROP CONSTRAINT CustomerPart_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GRRMapping_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[GRRMapping] DROP CONSTRAINT GRRMapping_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityMappingDetail_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[LinearityMappingDetail] DROP CONSTRAINT LinearityMappingDetail_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelShiftTarget_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelShiftTarget] DROP CONSTRAINT ModelShiftTarget_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelToolLife_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelToolLife] DROP CONSTRAINT ModelToolLife_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelToolLinkRange_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelToolLinkRange] DROP CONSTRAINT ModelToolLinkRange_FK02


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OperationToolLink_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[OperationToolLink] DROP CONSTRAINT OperationToolLink_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartMachine_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[PartMachine] DROP CONSTRAINT PartMachine_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartParameterGRR_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[PartParameterGRR] DROP CONSTRAINT PartParameterGRR_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[QapProcess_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[QapProcess] DROP CONSTRAINT QapProcess_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[StabilityMapping_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[StabilityMapping] DROP CONSTRAINT StabilityMapping_FK02


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BiasMapping_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[BiasMapping] DROP CONSTRAINT BiasMapping_FK02


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fixtureparameter_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[fixtureparameter] DROP CONSTRAINT fixtureparameter_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GRRMapping_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[GRRMapping] DROP CONSTRAINT GRRMapping_FK02


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityMappingDetail_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[LinearityMappingDetail] DROP CONSTRAINT LinearityMappingDetail_FK02


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartParameterGRR_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[PartParameterGRR] DROP CONSTRAINT PartParameterGRR_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[QapPartParameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[QapPartParameter] DROP CONSTRAINT QapPartParameter_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[StabilityMapping_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[StabilityMapping] DROP CONSTRAINT StabilityMapping_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Readings_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Readings] DROP CONSTRAINT Readings_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MachineOperation_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[MachineOperation] DROP CONSTRAINT MachineOperation_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[QapProcess_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[QapProcess] DROP CONSTRAINT QapProcess_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WoQapParameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[WoQapParameter] DROP CONSTRAINT WoQapParameter_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WoQapProcess_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[WoQapProcess] DROP CONSTRAINT WoQapProcess_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Users_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Users] DROP CONSTRAINT Users_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RootCauseDetail_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[RootCauseDetail] DROP CONSTRAINT RootCauseDetail_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelShiftTarget_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ModelShiftTarget] DROP CONSTRAINT ModelShiftTarget_FK02


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Production_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Production] DROP CONSTRAINT Production_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[StabilityReading_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[StabilityReading] DROP CONSTRAINT StabilityReading_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Production_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Production] DROP CONSTRAINT Production_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolIssueParameters_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ToolIssueParameters] DROP CONSTRAINT ToolIssueParameters_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolIssueParameterHist_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ToolIssueParameterHist] DROP CONSTRAINT ToolIssueParameterHist_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolParaChangeDetail_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ToolParaChangeDetail] DROP CONSTRAINT ToolParaChangeDetail_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolParaChangeDtlHist_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ToolParaChangeDtlHist] DROP CONSTRAINT ToolParaChangeDtlHist_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Tool_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Tool] DROP CONSTRAINT Tool_FK00


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolTypeParameter_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ToolTypeParameter] DROP CONSTRAINT ToolTypeParameter_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OperationToolLinkParamete_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[OperationToolLinkParameter] DROP CONSTRAINT OperationToolLinkParamete_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OperationToolLinkParamete_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[OperationToolLinkParameter] DROP CONSTRAINT OperationToolLinkParamete_FK02


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[QapPartParameter_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[QapPartParameter] DROP CONSTRAINT QapPartParameter_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WoQapParameter_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[WoQapParameter] DROP CONSTRAINT WoQapParameter_FK01


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartParameterGRR_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[PartParameterGRR] DROP CONSTRAINT PartParameterGRR_FK02
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Readings_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Readings] DROP CONSTRAINT Readings_FK01
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Supervisor_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Supervisor] DROP CONSTRAINT Supervisor_FK00
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[JobParameter_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[JobParameter] DROP CONSTRAINT JobParameter_FK01
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Job_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Job] DROP CONSTRAINT Job_FK00
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Batch_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Batch] DROP CONSTRAINT Batch_FK00
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WoQapParameter_FK02]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[WoQapParameter] DROP CONSTRAINT WoQapParameter_FK02
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WoQapProcess_FK01]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[WoQapProcess] DROP CONSTRAINT WoQapProcess_FK01
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FixtureMapping_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[FixtureMapping] DROP CONSTRAINT FixtureMapping_FK00
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fixtureparameter_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[fixtureparameter] DROP CONSTRAINT fixtureparameter_FK00
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fixtureprobes_FK00]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[fixtureprobes] DROP CONSTRAINT fixtureprobes_FK00
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Batch]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Batch]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BiasMapping]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BiasMapping]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BiasReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BiasReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ChartIndex]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ChartIndex]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Company]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Company]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CorrectiveAction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CorrectiveAction]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[EventRemarks]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[EventRemarks]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgingEventRemarks]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgingEventRemarks]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Country]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Country]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Customer]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Customer]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CustomerPart]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CustomerPart]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Department]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Department]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FixtureMapping]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[FixtureMapping]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GRRMapping]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[GRRMapping]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GRRReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[GRRReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistCorrectiveAction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistCorrectiveAction]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistJobDisposal]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistJobDisposal]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistMessages]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistMessages]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistNonConformities]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistNonConformities]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgBiasMapping]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgBiasMapping]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgBiasReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgBiasReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgGRRMapping]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgGRRMapping]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgGRRReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgGRRReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgLinearityMappingDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgLinearityMappingDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgLinearityMappingMaster]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgLinearityMappingMaster]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgLinearityReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgLinearityReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgStabilityMapping]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgStabilityMapping]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgStabilityReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgStabilityReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgingCorrectiveAction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgingCorrectiveAction]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgingJobDisposal]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgingJobDisposal]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistPurgingNonConformities]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistPurgingNonConformities]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryJob]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryJob]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryJobParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryJobParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryJobReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryJobReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryJobSample]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryJobSample]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryPurgingJob]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryPurgingJob]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryPurgingJobParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryPurgingJobParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryPurgingJobSample]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryPurgingJobSample]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryPurgingJobreading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryPurgingJobreading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryPurgingWoQAPParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryPurgingWoQAPParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryPurgingWoQAPProcess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryPurgingWoQAPProcess]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryPurgingWorkorder]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryPurgingWorkorder]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryWoQapParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryWoQapParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryWoQapProcess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryWoQapProcess]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HistoryWorkOrder]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[HistoryWorkOrder]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Instrument]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Instrument]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[InstrumentInterface]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[InstrumentInterface]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[InstrumentType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[InstrumentType]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Job]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Job]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[JobDisposal]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[JobDisposal]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[JobParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[JobParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[JobReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[JobReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[JobSample]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[JobSample]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LastNumber]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LastNumber]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityMappingDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LinearityMappingDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityMappingMaster]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LinearityMappingMaster]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LinearityReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LinearityReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LocalMachine]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LocalMachine]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Location]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Location]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Machine]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Machine]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MachineOperation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MachineOperation]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MachineType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MachineType]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MasteringDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MasteringDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MedianDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MedianDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MedianHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MedianHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Messages]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Messages]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelClose]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ModelClose]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelShiftTarget]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ModelShiftTarget]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelToolLife]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ModelToolLife]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ModelToolLinkRange]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ModelToolLinkRange]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[NPDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NPDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[NPHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NPHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[NonConformities]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[NonConformities]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OperationToolLink]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OperationToolLink]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OperationToolLinkParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OperationToolLinkParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PCTDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PCTDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PCTHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PCTHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Parameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Parameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ParameterType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ParameterType]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ParetoDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ParetoDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ParetoHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ParetoHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Part]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Part]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartMachine]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PartMachine]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PartParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PartParameterGRR]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PartParameterGRR]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PortReadings]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PortReadings]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Process]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Process]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Production]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Production]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[QapPartParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[QapPartParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[QapProcess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[QapProcess]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Readings]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Readings]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RecordLock]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[RecordLock]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Role]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Role]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RoleScreen]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[RoleScreen]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RootCause]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[RootCause]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RootCauseDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[RootCauseDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Shift]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Shift]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SixSigmaConversion]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[SixSigmaConversion]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[StabilityMapping]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[StabilityMapping]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[StabilityReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[StabilityReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[StatsConstants]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[StatsConstants]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Supervisor]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Supervisor]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempGRRReport]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempGRRReport]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempCpCpkPpPpk]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempCpCpkPpPpk]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempCpkPpkSummary]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempCpkPpkSummary]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempHistoryReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempHistoryReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempHistorySummary]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempHistorySummary]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempLinearity]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempLinearity]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempProduction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempProduction]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempSummary]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempSummary]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempTLMModelWise]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempTLMModelWise]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempTLMModelWiseReport]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempTLMModelWiseReport]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempTLMOperatwise]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempTLMOperatwise]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempTLMParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempTLMParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempTLMToolIssue]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempTLMToolIssue]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Tool]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Tool]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolChange]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolChange]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolChangeHist]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolChangeHist]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolIssue]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolIssue]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolIssueHist]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolIssueHist]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolIssueParameterHist]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolIssueParameterHist]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolIssueParameters]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolIssueParameters]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolLifeExceptions]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolLifeExceptions]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolParaChange]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolParaChange]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolParaChangeDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolParaChangeDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolParaChangeDtlHist]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolParaChangeDtlHist]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolParaChangeHist]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolParaChangeHist]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolType]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ToolTypeParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ToolTypeParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TrendForXBar]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TrendForXBar]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Trends]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Trends]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UnitOfMeasurement]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UnitOfMeasurement]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Users]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Users]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WoQapParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[WoQapParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WoQapProcess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[WoQapProcess]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WorkOrder]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[WorkOrder]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XBarRDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XBarRDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XBarRHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XBarRHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XBarSDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XBarSDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XBarSHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XBarSHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XBarSettings]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XBarSettings]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XMRDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XMRDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XMRHeader]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XMRHeader]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fixture]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fixture]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fixtureparameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fixtureparameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fixtureprobes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[fixtureprobes]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tempreject]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tempreject]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ChiSquare]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ChiSquare]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ZValue]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ZValue]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[D2TABLE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[D2TABLE]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TTable]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GAUGECALIBRATION]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[GAUGECALIBRATION]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ConfigurableParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Plants]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Plants]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ConfigurableParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Divisions]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Divisions]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Units]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Units]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Cells]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Cells]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UserDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MachineEvent]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MachineEventDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CSVFileDate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GRRResult]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ScanUnscanFile]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[President]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GManager]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UManager]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MailSendDate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ReadingDumpTime]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UserDetail]
 

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[AutoLogInUser]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[AutoLogInUser]

 
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DProduction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[DProduction]

 
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[RejectionDetails]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[RejectionDetails]

 

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[ConfMeasureDetail]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[ConfMeasureDetail]

 
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[ConfMeasureMaster]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[ConfMeasureMaster]

 
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[AuditLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[AuditLog]

 
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[JobParameterDetails]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[JobParameterDetails]


 
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempJob]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempJob]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempJobParameter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempJobParameter]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempJobReading]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempJobReading]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempJobSample]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempJobSample]
 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TempCorrectiveAction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TempCorrectiveAction]
 
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[ScanTableData]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[ScanTableData]

CREATE TABLE [dbo].[AutoLogInUser](
	[StationNo] [nvarchar](50) NULL,
	[UserCode] [nvarchar](6) NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Batch] (
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[BatchDate] [datetime] NULL ,
	[PlannedQuantity] [float] NULL ,
	[ProducedQuantity] [float] NULL ,
	[BatchReleasedBy] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[BiasMapping] (
	[BiasMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StudyDate] [datetime] NULL ,
	[NoOfReadings] [smallint] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MasterValue] [float] NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BiasValue] [float] NULL ,
	[Enddate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL,[ConfidenceLevel] [int] NULL,[NoOfSubGroups] [int] NULL,
	[SigmaR] [float] NULL,[SigmaB] [float] NULL,[TCalculated] [float] NULL,
	[TTabulated] [float] NULL,[DegreeOfFreedom] [float] NULL,[CILower] [float] NULL,
	[CIUpper] [float] NULL,[XDoubleBar] [float] NULL,
	[PROCESSVARIATION] [float] NOT NULL,[EVPERCENTAGE] [float] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[BiasReading] (
	[BiasMapSrNo] [int] NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingValue] [float] NULL,SubGroupNo [float] NOT NULL
) ON [PRIMARY]
 


CREATE TABLE [dbo].[CDetail] (
	[ReadingNo] [smallint] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[Reading] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[CHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ChartIndex] (
	[ChartType] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Company] (
	[CompanyName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AddressLine1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AddressLine2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[City] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Zip] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Telephone] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Fax] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ActivateSecurity] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Fontsizes] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OnLineChartPoints] [smallint] NULL ,
	[FirstCOMport] [smallint] NULL ,
	[GlobalTrendSetting] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WoJobCombine] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShowMsgNMin] [smallint] NULL,
	[ConfidenceLevel] [float] DEFAULT 0.05,
	[NonNormalityType] [nvarchar] (1) DEFAULT 'N',
	[WOManualAuto] [nvarchar] (1) DEFAULT 'A',
	[MasteringFrequency] [smallint] NULL ,
	[OP10StationActive] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SHAREDFOLDERPATH]  [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[EmailFrequency] [smallint] NOT NULL,
	[SMSFrequency] [smallint] NOT NULL,
	[SHIFTCHGDAY] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SHIFTCHGTIME] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[UNITMGRFREQUENCY] [smallint] NULL,
	[GMGRFREQUENCY] [smallint] NULL,
	[NONCONFIRMITYFREQUENCYDAY] [smallint] NULL,
	[LNUMCHK] [smallint] NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[CorrectiveAction] (
	[JobStartDate] [datetime] NOT NULL ,
	[TargetDateToComplete] [datetime] NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ResponsibilityAssignedDate] [datetime] NULL ,
	[CorrectiveActionTakenDate] [datetime] NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[ResponsibilityAssignedTo] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ResponsibilityAssignedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[DisposalActionCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CorrectiveAction] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CorrectiveActionTakenBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CorrectiveActionSrlNo] [float] NULL ,
	[ResponsibilityDomain] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RemarksForCompOfCA] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleDate] [datetime] NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Levels] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Trend] [smallint] NOT NULL ,
	[CorrectiveActionTakenTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Manned] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TrendSampleNos] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[EmailTag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SMSTag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SHIFTCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Country] (
	[CountryCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CountryName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Customer] (
	[CustomerCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[AddressLine1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CountryCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[AddressLine2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AddressLine3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[City] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[State] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegionName] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CustomerName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FaxNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TelephoneNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[EMailAddress] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WebAddress] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ZipCode] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, 
	[VendorCode] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[VendorEmail] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[DSSEmail] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[FTPUploadFrequency] [int] NULL,
	[FTPServer] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[FTPUser] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[FTPPassword] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[FTPFolder] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[LastUploadDateTime] [datetime] NULL 	
) ON [PRIMARY]
 

CREATE TABLE [dbo].[CustomerPart] (
	[CustomerCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CustomerPartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CustomerCatalogId] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CustomerDrgFileName] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Department] (
	[DepartmentCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[DepartmentDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[FixtureMapping] (
	[FixtureCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SequenceNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MasterValue] [float] NULL ,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DNPattern] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[GRRMapping] (
	[GRRMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StudyDate] [datetime] NULL ,
	[TrialsFixed] [smallint] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfOperators] [smallint] NULL ,
	[MasterValue] [float] NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfParts] [smallint] NULL ,
	[Tolerance] [float] NULL ,
	[ProcessVariation] [float] NULL ,
	[SubTrialsCompleted] [smallint] NULL ,
	[XChartRemarks] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RChartRemarks] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[EndDate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL ,
	[TotalVariation] [float] NULL ,
	[RnRAvgRange] [float] NULL ,
	[RnRANOVA] [float] NULL ,
	[TVANOVA] [float] NULL,
	[PPVALUE] [FLOAT] NOT NULL,
	[LSL] [FLOAT] NOT NULL,
	[USL] [FLOAT] NOT NULL  
) ON [PRIMARY]
 

CREATE TABLE [dbo].[GRRReading] (
	[GRRMapSrNo] [int] NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[TrialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingValue] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistCorrectiveAction] (
	[JobStartDate] [datetime] NOT NULL ,
	[TargetDateToComplete] [datetime] NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ResponsibilityAssignedDate] [datetime] NULL ,
	[CorrectiveActionTakenDate] [datetime] NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[ResponsibilityAssignedTo] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ResponsibilityAssignedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[DisposalActionCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CorrectiveAction] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CorrectiveActionTakenBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CorrectiveActionSrlNo] [float] NULL ,
	[ResponsibilityDomain] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RemarksForCompOfCA] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleDate] [datetime] NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Levels] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Trend] [smallint] NOT NULL ,
	[CorrectiveActionTakenTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Manned] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TrendSampleNos] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 	[EmailTag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SMSTag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SHIFTCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistDetail] (
	[Reading] [float] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UOMDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[FromDate] [datetime] NULL ,
	[ToDate] [datetime] NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StdDeviation] [real] NULL ,
	[OneSideInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistJobDisposal] (
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[DisposalActionCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReworkProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RawMaterialCostPerPiece] [float] NULL ,
	[LabourFactorPerPiece] [float] NULL ,
	[AdmnFactorPerPiece] [float] NULL ,
	[ProcChrgsPerPiece] [float] NULL ,
	[NoOfPieces] [smallint] NULL ,
	[DisposalActionComment] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DisposalActionCompletedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkJobStartedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistMessages] (
	[SendDate] [datetime] NULL ,
	[FromMachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToMachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Message] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 

CREATE TABLE [dbo].[HistNonConformities] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[XBar] [float] NULL ,
	[UCLXBarValue] [float] NULL ,
	[LCLXBarValue] [float] NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleDate] [datetime] NOT NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgBiasMapping] (
	[BiasMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StudyDate] [datetime] NULL ,
	[NoOfReadings] [smallint] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MasterValue] [float] NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BiasValue] [float] NULL ,
	[Enddate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL,[ConfidenceLevel] [int] NULL,[NoOfSubGroups] [int] NULL,
	[SigmaR] [float] NULL,[SigmaB] [float] NULL,[TCalculated] [float] NULL,
	[TTabulated] [float] NULL,[DegreeOfFreedom] [float] NULL,[CILower] [float] NULL,
	[CIUpper] [float] NULL,[XDoubleBar] [float] NULL,
	[PROCESSVARIATION] [float] NOT NULL,[EVPERCENTAGE] [float] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgBiasReading] (
	[BiasMapSrNo] [int] NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingValue] [float] NULL,SubGroupNo [float] NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgGRRMapping] (
	[GRRMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StudyDate] [datetime] NULL ,
	[TrialsFixed] [smallint] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfOperators] [smallint] NULL ,
	[MasterValue] [float] NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfParts] [smallint] NULL ,
	[Tolerance] [float] NULL ,
	[ProcessVariation] [float] NULL ,
	[SubTrialsCompleted] [smallint] NULL ,
	[XChartRemarks] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RChartRemarks] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[EndDate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL ,
	[TotalVariation] [float] NULL ,
	[RnRAvgRange] [float] NULL ,
	[RnRANOVA] [float] NULL ,
	[TVANOVA] [float] NULL ,
	[PPVALUE] [FLOAT] NOT NULL,
	[LSL] [FLOAT] NOT NULL,
	[USL] [FLOAT] NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgGRRReading] (
	[GRRMapSrNo] [int] NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[TrialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingValue] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgLinearityMappingDetail] (
	[LinearityMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaSeqNo] [smallint] NULL ,
	[ReferenceValue] [float] NULL ,
	[Bias] [float] NULL,[CILower] [float] NULL,[CIUpper] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgLinearityMappingMaster] (
	[LinearityMapSrNo] [int] NOT NULL ,
	[StudyDate] [datetime] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfReadings] [smallint] NULL ,
	[AverageBias] [float] NULL ,
	[Linearity] [float] NULL ,
	[GoodnessOfFit] [float] NULL ,
	[SlopeOfRegression] [float] NULL ,
	[EndDate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL,[ConfidenceLevel] [int] NULL ,[DFValue] [float] NULL ,
	[SValue] [float] NULL,[TaCalculated] [float] NULL ,[TbCalculated] [float] NULL ,
	[TTabulated] [float] NULL,[Intercept] [float] NULL ,
	[PROCESSVARIATION] [FLOAT] NOT NULL,[EVPERCENTAGE] [FLOAT] NOT NULL	
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgLinearityReading] (
	[LinearityMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingValue] [float] NULL,[Bias] [float] NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgStabilityMapping] (
	[StabilityMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StudyDate] [datetime] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[EndDate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgStabilityReading] (
	[StabilityMapSrNo] [int] NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingValue] [float] NULL ,
	[Remark] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgingCorrectiveAction] (
	[JobStartDate] [datetime] NOT NULL ,
	[TargetDateToComplete] [datetime] NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ResponsibilityAssignedDate] [datetime] NULL ,
	[CorrectiveActionTakenDate] [datetime] NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[ResponsibilityAssignedTo] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ResponsibilityAssignedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[DisposalActionCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CorrectiveAction] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CorrectiveActionTakenBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CorrectiveActionSrlNo] [float] NULL ,
	[ResponsibilityDomain] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RemarksForCompOfCA] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleDate] [datetime] NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Levels] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Trend] [smallint] NOT NULL ,
	[CorrectiveActionTakenTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Manned] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TrendSampleNos] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[EmailTag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SMSTag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, 
	[SHIFTCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgingJobDisposal] (
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[DisposalActionCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReworkProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RawMaterialCostPerPiece] [float] NULL ,
	[LabourFactorPerPiece] [float] NULL ,
	[AdmnFactorPerPiece] [float] NULL ,
	[ProcChrgsPerPiece] [float] NULL ,
	[NoOfPieces] [smallint] NULL ,
	[DisposalActionComment] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DisposalActionCompletedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkJobStartedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgingNonConformities] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[XBar] [float] NULL ,
	[UCLXBarValue] [float] NULL ,
	[LCLXBarValue] [float] NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleDate] [datetime] NOT NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryJob] (
	[ReworkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchDate] [datetime] NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobCloseDate] [datetime] NOT NULL ,
	[JobClosetime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReworkOnJobserialNo] [float] NULL ,
	[ProducedQty] [float] NOT NULL ,
	[WoQapSeqNo] [smallint] NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[QapID] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkSerialNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ImportedJob] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LotNumber] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SINGLEINSTRUMENT] [nvarchar] (1) DEFAULT 'N',
	[SINGLESWITCH] [nvarchar] (1) DEFAULT 'N',
	[TableNames]  [nvarchar](50),
	[EngineNoFieldlNo] int,
	[DateTimesFieldlNo] int
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryJobParameter] (
	[SetCpPpkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SetControlLimit] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspProcCompInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchDate] [datetime] NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[LCLXBar] [float] NULL ,
	[UCLXBar] [float] NULL ,
	[LSLValue] [float] NULL ,
	[USLValue] [float] NULL ,
	[LCLR] [float] NULL ,
	[UCLR] [float] NULL ,
	[LCLS] [float] NULL ,
	[UCLS] [float] NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReworkonJobSerialNo] [float] NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[MinLotSize] [smallint] NULL ,
	[SampleSetNo] [smallint] NULL ,
	[SampleSize] [smallint] NOT NULL ,
	[FinalInspSetNo] [smallint] NULL ,
	[ActiveChannel] [smallint] NULL ,
	[SubGroupSize] [int] NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionID] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkSerialNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FixtureCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SequenceNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MasterValue] [float] NULL ,
	[FixtureSeqNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CalibrationValue] [float] NULL ,
	[DNPattern] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CLCalculateSpecifyInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CheckSpecLmtInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UCLRInitValue] [float] NULL ,
	[LCLRInitValue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[LCLInitXbar] [float] NULL ,
	[UCLInitXbar] [float] NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReCalcLimitAfterSamples] [smallint] NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BestSample] [float] NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL ,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MappedSequence] [int] NULL,
	[InstrumentAddress] [smallint] NULL,
	[CpkPpkLastSamples] [smallint] DEFAULT 0,
    [LastCp] [float] NULL,
   	[LastCpk] [float] NULL,  
	[LastPp] [float] NULL, 
	[LastPpk] [float] NULL,
	[AckChannelNo] [smallint] NULL,
	[ColorStatus] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL  
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryJobReading] (
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Reading] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[SampleNo] [float] NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Variation] [float] NULL ,
	[ComponentNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[IntermediateSrlNo] [float] NULL ,
	[IntermediateSrlDate] [datetime] NULL ,
	[RollNo] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [HomogenizationInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[DateCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[OPERATOR] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[READINGMODE] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryJobSample] (
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SetFault] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DisposalActionTakenInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[HomogenizationInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleDate] [datetime] NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionTakenDate] [datetime] NULL ,
	[DecisionTakenTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JobSerialno] [float] NOT NULL ,
	[XBar] [float] NULL ,
	[UCLXBarValue] [float] NULL ,
	[LCLXBarValue] [float] NULL ,
	[StdDeviation] [float] NULL ,
	[SampleRange] [float] NULL ,
	[DecisionQty] [float] NULL ,
	[SampleNo] [float] NOT NULL ,
	[ReworkSeqNo] [smallint] NULL ,
	[SubGroupSize] [int] NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Operator] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionTakenBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionExplanation] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AssignableCause] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[DieCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SupervisorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL   
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryPurgingJob] (
	[ReworkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchDate] [datetime] NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobCloseDate] [datetime] NOT NULL ,
	[JobClosetime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReworkOnJobserialNo] [float] NULL ,
	[ProducedQty] [float] NOT NULL ,
	[WoQapSeqNo] [smallint] NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[QapID] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkSerialNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ImportedJob] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LotNumber] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SINGLEINSTRUMENT] [nvarchar] (1) DEFAULT 'N',
	[SINGLESWITCH] [nvarchar] (1) DEFAULT 'N',
	[TableNames]  [nvarchar](50),
	[EngineNoFieldlNo] int,
	[DateTimesFieldlNo] int
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryPurgingJobParameter] (
	[SetCpPpkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SetControlLimit] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspProcCompInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchDate] [datetime] NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[LCLXBar] [float] NULL ,
	[UCLXBar] [float] NULL ,
	[LSLValue] [float] NULL ,
	[USLValue] [float] NULL ,
	[LCLR] [float] NULL ,
	[UCLR] [float] NULL ,
	[LCLS] [float] NULL ,
	[UCLS] [float] NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReworkonJobSerialNo] [float] NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[MinLotSize] [smallint] NULL ,
	[SampleSetNo] [smallint] NULL ,
	[SampleSize] [smallint] NOT NULL ,
	[FinalInspSetNo] [smallint] NULL ,
	[ActiveChannel] [smallint] NULL ,
	[SubGroupSize] [int] NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionID] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkSerialNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FixtureCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SequenceNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MasterValue] [float] NULL ,
	[FixtureSeqNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CalibrationValue] [float] NULL ,
	[DNPattern] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CLCalculateSpecifyInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CheckSpecLmtInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UCLRInitValue] [float] NULL ,
	[LCLRInitValue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[LCLInitXbar] [float] NULL ,
	[UCLInitXbar] [float] NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReCalcLimitAfterSamples] [smallint] NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BestSample] [float] NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MappedSequence] [int] NULL,
	[InstrumentAddress] [smallint] NULL,
	[CpkPpkLastSamples] [smallint] DEFAULT 0,
    [LastCp] [float] NULL,
    [LastCpk] [float] NULL,  
	[LastPp] [float] NULL, 
	[LastPpk] [float] NULL,
	[AckChannelNo] [smallint] NULL,
    [ColorStatus] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL  
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryPurgingJobSample] (
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SetFault] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DisposalActionTakenInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[HomogenizationInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleDate] [datetime] NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionTakenDate] [datetime] NULL ,
	[DecisionTakenTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JobSerialno] [float] NOT NULL ,
	[XBar] [float] NULL ,
	[UCLXBarValue] [float] NULL ,
	[LCLXBarValue] [float] NULL ,
	[StdDeviation] [float] NULL ,
	[SampleRange] [float] NULL ,
	[DecisionQty] [float] NULL ,
	[SampleNo] [float] NOT NULL ,
	[ReworkSeqNo] [smallint] NULL ,
	[SubGroupSize] [int] NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Operator] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionTakenBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionExplanation] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AssignableCause] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[DieCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SupervisorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryPurgingJobreading] (
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Reading] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[SampleNo] [float] NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Variation] [float] NULL ,
	[ComponentNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[IntermediateSrlNo] [float] NULL ,
	[IntermediateSrlDate] [datetime] NULL ,
	[RollNo] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [HomogenizationInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [DateCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [OPERATOR] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[READINGMODE] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryPurgingWoQAPParameter] (
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CriticalInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReCalcControlLimitInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MeasuringType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CLCalculateSpecifyInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CheckSpecLmtInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[UCLRInitValue] [float] NULL ,
	[LCLRInitValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[USLValue] [float] NULL ,
	[SettingValue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[BestSample] [float] NULL ,
	[LCLInitXbar] [float] NULL ,
	[UCLInitXbar] [float] NULL ,
	[Chart] [float] NULL ,
	[NumberOfSubGroups] [float] NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[PartParaSeqNo] [smallint] NOT NULL ,
	[SampleSize] [smallint] NULL ,
	[ActiveChannel] [smallint] NULL ,
	[SampleFrequency] [smallint] NULL ,
	[ReCalcLimitAfterSamples] [smallint] NULL ,
	[SubGroupSize] [int] NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[FinalInspectionID] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InterFaceCode] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleUnit] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CalibrationValue] [float] NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL ,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MappedSequence] [int] NULL,
   	[InstrumentAddress] [smallint] NULL,
    [CpkPpkLastSamples] [smallint] DEFAULT 0
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryPurgingWoQAPProcess] (
	[ApplicabilityInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionProcessInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PreparedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LotNumber] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryPurgingWorkorder] (
	[WorkOrderType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[WorkOrderCloseDate] [datetime] NULL ,
	[TargetQty] [float] NOT NULL ,
	[ProducedQty] [float] NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryWoQapParameter] (
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CriticalInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReCalcControlLimitInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MeasuringType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CLCalculateSpecifyInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CheckSpecLmtInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[UCLRInitValue] [float] NULL ,
	[LCLRInitValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[USLValue] [float] NULL ,
	[SettingValue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[BestSample] [float] NULL ,
	[LCLInitXbar] [float] NULL ,
	[UCLInitXbar] [float] NULL ,
	[Chart] [float] NULL ,
	[NumberOfSubGroups] [float] NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[PartParaSeqNo] [smallint] NOT NULL ,
	[SampleSize] [smallint] NULL ,
	[ActiveChannel] [smallint] NULL ,
	[SampleFrequency] [smallint] NULL ,
	[ReCalcLimitAfterSamples] [smallint] NULL ,
	[SubGroupSize] [int] NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[FinalInspectionID] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InterFaceCode] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleUnit] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CalibrationValue] [float] NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MappedSequence] [int] NULL,
 	[InstrumentAddress] [smallint] NULL,
    [CpkPpkLastSamples] [smallint] DEFAULT 0
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryWoQapProcess] (
	[ApplicabilityInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionProcessInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PreparedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LotNumber] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistoryWorkOrder] (
	[WorkOrderType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[WorkOrderCloseDate] [datetime] NULL ,
	[TargetQty] [float] NOT NULL ,
	[ProducedQty] [float] NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Instrument] (
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CalibrationDate] [datetime] NULL ,
	[NoOfDaysForCalibration] [smallint] NULL ,
	[NoOfReadingsForCalibration] [smallint] NULL ,
	[ReadingCounter] [smallint] NULL ,
	[Description] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LeastCount] [float] NULL ,
	[InterfaceCode] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Responsible] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BaudRate] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Parity] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Databits] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Stopbits] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ChannelNo] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AckChannelNo] [smallint] NULL ,
	[InstIdCommand] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[DisplayPortNo] [smallint] NULL,
	[DisplayCpk] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[CALIBRATIONFREQUENCY] [smallint] NULL,
	[GaugeRange] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Make] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[GrrValue] [Float] NULL,
	[GrrStudyDate] [datetime] NULL,
	[GrrFrequency] [smallint] NULL,
	[GrrDueDate] [datetime] NULL,
	[HistoryCardNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Remarks] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[InUse] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[AcceptanceCriteria] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[GaugeDrawingNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[InstrumentInterface] (
	[InterfaceCode] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[NoOfChannels] [smallint] NULL ,
	[InterfaceDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SerialPort] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ParallelPort] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InterfaceDLL] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoParametersPerDump] [smallint] NULL ,
	[ParallelPortDataBits] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[InstrumentType] (
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[InstrumentTypeDesc] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InterfaceCode] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BaudRate] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Parity] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DataBits] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StopBits] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Job] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[QapProcessSeqNo] [smallint] NULL ,
	[JobSerialno] [float] NOT NULL ,
	[JobStartDate] [datetime] NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReworkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobCloseDate] [datetime] NULL ,
	[BatchDate] [datetime] NULL ,
	[JobClosetime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProducedQty] [float] NULL ,
	[ReworkOnJobSerialNo] [float] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReworkSerialNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ByPiece] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ImportedJob] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LotNumber] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SINGLEINSTRUMENT] [nvarchar] (1) DEFAULT 'N',
	[SINGLESWITCH] [nvarchar] (1) DEFAULT 'N',
	[TableNames]  [nvarchar](50),
	[EngineNoFieldlNo] int,
	[DateTimesFieldlNo] int
) ON [PRIMARY]
 

CREATE TABLE [dbo].[JobDisposal] (
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[DisposalActionCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReworkProcessCode] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RawMaterialCostPerPiece] [float] NULL ,
	[LabourFactorPerPiece] [float] NULL ,
	[AdmnFactorPerPiece] [float] NULL ,
	[ProcChrgsPerPiece] [float] NULL ,
	[NoOfPieces] [smallint] NULL ,
	[DisposalActionComment] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DisposalActionCompletedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkJobStartedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[JobParameter] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JobStartDate] [datetime] NULL ,
	[QapProcessSeqNo] [smallint] NULL ,
	[SetCpPpkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SetControlLimit] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspProcCompInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ReWorkOnJobSerialNo] [int] NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[LCLXBar] [float] NULL ,
	[UCLXBar] [float] NULL ,
	[LSLValue] [float] NULL ,
	[USLValue] [float] NULL ,
	[LCLR] [float] NULL ,
	[UCLR] [float] NULL ,
	[LCLS] [float] NULL ,
	[UCLS] [float] NULL ,
	[SampleSize] [smallint] NULL ,
	[MinLotSize] [smallint] NULL ,
	[SampleSetNo] [smallint] NULL ,
	[FinalInspSetNo] [smallint] NULL ,
	[ActiveChannel] [smallint] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[FinalInspectionID] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReWorkSerialNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchDate] [datetime] NULL ,
	[SubGroupSize] [int] NULL ,
	[Fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[sequenceno] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mastervalue] [float] NULL ,
	[FixtureSeqNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SerialPort] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ParallelPort] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CalibrationValue] [float] NULL ,
	[DNPattern] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CLCalculateSpecifyInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CheckSpecLmtInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UCLRInitValue] [float] NULL ,
	[LCLRInitValue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[LCLInitXbar] [float] NULL ,
	[UCLInitXbar] [float] NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReCalcLimitAfterSamples] [smallint] NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BestSample] [float] NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL, 
	[MappedSequence] [smallint] NULL,
	[InstrumentAddress] [smallint] NULL,
	[ColorStatus] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [CpkPpkLastSamples] [smallint] DEFAULT 0,
    [LastCp] [float] NULL,
    [LastCpk] [float] NULL,  
	[LastPp] [float] NULL, 
	[LastPpk] [float] NULL,
	[AckChannelNo] [smallint] NULL  
) ON [PRIMARY]
 

CREATE TABLE [dbo].[JobReading] (
	[ReadingSerialNo] [smallint] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Reading] [float] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Grade] [nvarchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Variation] [float] NULL ,
	[ComponentNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[IntermediateSrlNo] [float] NULL ,
	[IntermediateSrlDate] [datetime] NULL ,
	[RollNo] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [HomogenizationInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [DateCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[OPERATOR] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[READINGMODE] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL	
	) ON [PRIMARY]
 

CREATE TABLE [dbo].[EventRemarks] (
[JobSerialno] [float] NOT NULL ,
[ReadingSerialNo] [smallint] NOT NULL ,
[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[SampleNo] [float] NOT NULL ,
[Remarks] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Reading] [float] NOT NULL ,
[ReadingDate] [datetime] NULL ,
[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[RemarksDate] [datetime] NULL ,
[RemarksTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ReadingDecOrAngle] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MachineEvent] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SrNo] [smallint] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[HistPurgingEventRemarks] (
[JobSerialno] [float] NOT NULL ,
[ReadingSerialNo] [smallint] NOT NULL ,
[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[SampleNo] [float] NOT NULL ,
[Remarks] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Reading] [float] NOT NULL ,
[ReadingDate] [datetime] NULL ,
[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[RemarksDate] [datetime] NULL ,
[RemarksTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ReadingDecOrAngle] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MachineEvent] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SrNo] [smallint] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[JobSample] (
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SetFault] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DisposalActionTakenInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleDate] [datetime] NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionTakenDate] [datetime] NULL ,
	[DecisionTakenTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionQty] [float] NULL ,
	[XBar] [float] NULL ,
	[UCLXBarValue] [float] NULL ,
	[LCLXBarValue] [float] NULL ,
	[StdDeviation] [float] NULL ,
	[SampleRange] [float] NULL ,
	[ReworkSeqNo] [smallint] NULL ,
	[SubGroupSize] [int] NULL ,
	[DecisionExplanation] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Operator] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DecisionTakenBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReworkProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[HomogenizationInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AssignableCause] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[HomogenizedDate] [datetime] NULL ,
	[HomogenizedTime] [datetime] NULL,
	[DieCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SupervisorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[LastNumber] (
	[JobSerialno] [float] NOT NULL ,
	[SampleNo] [float] NULL ,
	[PartNo] [float]  NULL ,
	[WorkOrderNo] [float] NULL ,
	[FinalSerialNo] [float] NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[LGEVENT] ([JOBSERIALNO] [float] NOT NULL,
	[PARTPARACODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[STATIONNO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[SCREENHANDLE] [float] NOT NULL,[REQUESTID] [smallint] 
) ON [PRIMARY]
 


CREATE TABLE [dbo].[LinearityMappingDetail] (
	[LinearityMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaSeqNo] [smallint] NULL ,
	[ReferenceValue] [float] NULL ,
	[Bias] [float] NULL,[CILower] [float] NULL,[CIUpper] [float] NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[LinearityMappingMaster] (
	[LinearityMapSrNo] [int] NOT NULL ,
	[StudyDate] [datetime] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfReadings] [smallint] NULL ,
	[AverageBias] [float] NULL ,
	[Linearity] [float] NULL ,
	[GoodnessOfFit] [float] NULL ,
	[SlopeOfRegression] [float] NULL ,
	[EndDate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL,[ConfidenceLevel] [int] NULL ,[DFValue] [float] NULL ,
	[SValue] [float] NULL,[TaCalculated] [float] NULL ,[TbCalculated] [float] NULL ,
	[TTabulated] [float] NULL,[Intercept] [float] NULL,
	[PROCESSVARIATION] [FLOAT] NOT NULL,[EVPERCENTAGE] [FLOAT] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[LinearityReading] (
	[LinearityMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingValue] [float] NULL,[Bias] [float] NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[LocalMachine] (
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ParallelPort] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Manned] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Location] (
	[LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[LocationDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, 
    [RunningLine] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL Default 'Y'
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Machine] (
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Description] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Machinetype] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RatePerHr] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[MachineOperation] (
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[MachineType] (
	[Machinetype] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Description] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[MasteringDetail] (
	[JobSerialno] [float] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mastervalue] [float] NULL ,
	[CalibrationValue] [float] NULL ,
	[ChangeDate] [datetime] NOT NULL ,
	[ChangeTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[MedianDetail] (
	[SampleNo] [float] NULL ,
	[ChartSerialNumber] [smallint] NULL ,
	[MedianValue] [float] NULL ,
	[SampleRange] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[MedianHeader] (
	[ChartSerialNumber] [smallint] NULL ,
	[SampleSize] [smallint] NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[UclMedian] [float] NULL ,
	[LCLMedian] [float] NULL ,
	[Uclr] [float] NULL ,
	[Lclr] [float] NULL ,
	[XMedianBar] [float] NULL ,
	[RBar] [float] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Workorderno] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Machineno] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Processdescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Partparadescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Uomdescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[A2] [float] NULL ,
	[D3] [float] NULL ,
	[D4] [float] NULL ,
	[Processcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Partparacode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[Sd] [float] NULL ,
	[Stationno] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Messages] (
	[SendDate] [datetime] NULL ,
	[FromMachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToMachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Message] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 

CREATE TABLE [DBO].[MEASUREMENTINSTANCE] ([JOBSERIALNO] [float] NOT NULL,
	[STATIONNO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[LOCALPORT] [smallint] NOT NULL,[SCREENHANDLE] [float] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ModelClose] (
	[OldPartno] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[NewPartno] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartSerialNo] [int] NOT NULL ,
	[Machineno] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Shiftcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[shiftdate] [datetime] NULL ,
	[USercode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DateTimeStamp] [datetime] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ModelShiftTarget] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[TargetQuantity] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ModelToolLife] (
	[PartNO] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[ExpectedLife] [float] NULL ,
	[AlertQuantity] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ModelToolLinkRange] (
	[PartNO] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParaCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RangeFrom] [float] NULL ,
	[RangeTo] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[NPDetail] (
	[ReadingNo] [smallint] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[Reading] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[NPHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[NonConformities] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[XBar] [float] NULL ,
	[UCLXBarValue] [float] NULL ,
	[LCLXBarValue] [float] NULL ,
	[ServerId] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleDate] [datetime] NOT NULL ,
	[SampleTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[OperationToolLink] (
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ModelSpecific] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[OperationToolLinkParameter] (
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParaCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PCTDetail] (
	[ReadingNo] [smallint] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[XValue] [float] NULL ,
	[ReadingDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PCTHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SampleSize] [smallint] NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[XBar] [float] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UOMDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OneSideInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PDetail] (
	[ReadingNo] [smallint] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[Reading] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Parameter] (
	[ParaTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParaCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParaDesc] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ParameterType] (
	[ParaTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParaTypeDesc] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ParetoDetail] (
	[ChartSerialNumber] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RootCauseCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Noofnonconformities] [smallint] NULL ,
	[TotalPercent] [float] NULL ,
	[CumulativePercent] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ParetoHeader] (
	[ChartSerialNumber] [smallint] NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FromDate] [datetime] NULL ,
	[ToDate] [datetime] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Part] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Specification] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DrawingNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DrawingFileName] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DrawingIssueIndex] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessChartReleasedBy] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RateOfRawMaterial] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PartMachine] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProductionCapacityPerhr] [float] NULL,
	[DieCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PartParameter] (
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PartParameterGRR] (
	[SerialNo] [int] NOT NULL ,
	[PartCode] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ParameterCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MapDate] [datetime] NULL ,
	[TrialsFixed] [smallint] NULL ,
	[SubTrialsCompleted] [smallint] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadMode] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfOperators] [smallint] NULL ,
	[MasterValue] [float] NULL ,
	[CalibrationValue] [float] NULL ,
	[GainFactor] [float] NULL ,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RChartRemarks] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[XBarChartRemarks] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Decimals] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DumpDynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[PortReadings] (
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingDateTime] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL ,
	[Reading] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Process] (
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Production] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProductionQty] [float] NULL ,
	[DateTimeStamp] [datetime] NULL ,
	[ShiftDate] [datetime] NOT NULL ,
	[supervisorcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CloseStatus] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[QapPartParameter] (
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CriticalInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MeasuringType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CLCalculateSpecifyInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ChkSpecLmtInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaSeqNo] [int] NULL ,
	[NoOfSubGroups] [float] NULL ,
	[LSLValue] [float] NULL ,
	[USLValue] [float] NULL ,
	[LCLRInitValue] [float] NULL ,
	[UCLRInitValue] [float] NULL ,
	[SettingValue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[BestSample] [float] NULL ,
	[LCLInitXbar] [float] NULL ,
	[UCLInitXbar] [float] NULL ,
	[Chart] [float] NULL ,
	[SampleSize] [smallint] NULL ,
	[SampleFrequency] [smallint] NULL ,
	[RecalcLimitAfterSamples] [smallint] NULL ,
	[SubgroupSize] [int] NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[FinalInspectionID] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InterfaceCode] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleUnit] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL ,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MappedSequence] [int] NULL,
	[InstrumentAddress] [smallint] NULL,
    [CpkPpkLastSamples] [smallint] DEFAULT 0
) ON [PRIMARY]
 

CREATE TABLE [dbo].[QapProcess] (
	[QapProcessSeqNo] [smallint] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ApplicabilityInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionProcessInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PreparedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LotNumber] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TableNames]  [nvarchar](50),
	[EngineNoFieldlNo] int,
	[DateTimesFieldlNo] int
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Readings] (
	[SerialNo] [int] NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartCode] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParameterCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[TrialNo] [int] NOT NULL ,
	[RDate] [datetime] NULL ,
	[RTime] [datetime] NULL ,
	[Reading1] [float] NULL ,
	[Reading2] [float] NULL ,
	[Reading3] [float] NULL ,
	[Reading4] [float] NULL ,
	[Reading5] [float] NULL ,
	[Reading6] [float] NULL ,
	[Reading7] [float] NULL ,
	[Reading8] [float] NULL ,
	[Reading9] [float] NULL ,
	[Reading10] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[RecordLock] (
	[FormName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TableName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RecordId1] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RecordId2] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RecordId3] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RecordId4] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RecordId5] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Station_no] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Locked_when] [datetime] NULL ,
	[UserCOde] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Role] (
	[RoleID] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ActiveInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RoleName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UserRights] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[RoleScreen] (
	[ScreenName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[RootCause] (
	[RootCauseCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PreparationDate] [datetime] NULL ,
	[RootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PreparedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[RootCauseDetail] (
	[RootCauseCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SubRootCauseCode] [smallint] NOT NULL ,
	[SubRootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Shift] (
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ShiftStartTime] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftEndTime] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[SixSigmaConversion] (
	[SigmaValue] [float] NULL ,
	[DefectsPerMillion] [real] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[StabilityMapping] (
	[StabilityMapSrNo] [int] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StudyDate] [datetime] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[EndDate] [datetime] NULL ,
	[CreatedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreationTimeStamp] [datetime] NULL ,
	[ModifiedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModifiedTimeStamp] [datetime] NULL ,
	[ChannelNo] [smallint] NULL ,
	[SrlPrllPortFlag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PortNo] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[StabilityReading] (
	[StabilityMapSrNo] [int] NOT NULL ,
	[OperatorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingSerialNo] [smallint] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [datetime] NULL ,
	[ReadingValue] [float] NULL ,
	[Remark] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[StatsConstants] (
	[SampleSize] [smallint] NOT NULL ,
	[A2] [float] NULL ,
	[B3] [float] NULL ,
	[B4] [float] NULL ,
	[D2] [float] NULL ,
	[D3] [float] NULL ,
	[D4] [float] NULL ,
	[A3] [float] NULL ,
	[E2] [float] NULL ,
	[A2Median] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Supervisor] (
	[SupervisorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Colour] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[images] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 

CREATE TABLE [dbo].[TempGRRReport] (
	[SerialNo] [int] NULL ,
	[PartSrlNo] [smallint] NULL ,
	[OperatorCodeA] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrialA1] [float] NULL ,
	[TrialA2] [float] NULL ,
	[TrialA3] [float] NULL ,
	[AverageA] [float] NULL ,
	[RangeA] [float] NULL ,
	[OperatorCodeB] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrialB1] [float] NULL ,
	[TrialB2] [float] NULL ,
	[TrialB3] [float] NULL ,
	[AverageB] [float] NULL ,
	[RangeB] [float] NULL ,
	[OperatorCodeC] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrialC1] [float] NULL ,
	[TrialC2] [float] NULL ,
	[TrialC3] [float] NULL ,
	[AverageC] [float] NULL ,
	[RangeC] [float] NULL ,
	[XpBar] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempCpCpkPpPpk] (
[JOBSTARTDATE] [datetime] NULL ,
[PARTNO] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[WORKORDERNO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MACHINENO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[OPERATORCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PROCESSCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PARTPARACODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ONESIDEDIND] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CPGREATERTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CPEQUALTO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CPLESSTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CPKGREATERTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CPKEQUALTO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CPKLESSTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , 
[PPGREATERTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PPEQUALTO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PPLESSTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PPKGREATERTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PPKEQUALTO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PPKLESSTHAN] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[STATIONNO] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 
	
CREATE TABLE [dbo].[TempCpkPpkSummary] (
[PARTNO] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[WORKORDERNO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PARTPARACODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MACHINENO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
JOBSERIALNO [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
JOBSTARTDATE [datetime] NULL,
LSL [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
USL [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
SAMPLENO [float] NULL ,
READINGSERIALNO [float] NULL ,
READING [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
CP [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL  ,
CPK [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL  ,
PP [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL  ,
PPK [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
RANGE [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL  ,
READSIGMA [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
STATIONNO [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 	

CREATE TABLE [dbo].[TempVariation] (
[JOBSTARTDATE] [datetime] NULL ,
[PARTNO] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[WORKORDERNO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MACHINENO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PROCESSCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[JOBSERIALNO] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[BATCHNO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[COMPONENTNO] [float]  NULL ,
[READINGDATES] [datetime]  NULL,
[P1CODE] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P1LSL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P1USL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P1READING] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , 
[P1VARIATION] [float]   NULL ,
[P2CODE] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P2LSL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P2USL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P2READING] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P2VARIATION] [float]   NULL ,
[P3CODE] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P3LSL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P3USL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P3READING] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P3VARIATION] [float]   NULL ,
[P4CODE] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P4LSL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P4USL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P4READING] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P4VARIATION] [float]  NULL ,
[P5CODE] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P5LSL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P5USL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P5READING] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P5VARIATION] [float]   NULL ,
[P6CODE] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P6LSL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P6USL] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P6READING] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[P6VARIATION] [float]   NULL ,
[STATIONNO] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempOP10FSReports] (
	[WorkOrderNoOP10] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNoFS] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
       [PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode1] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
       [ProcessCode2] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo1] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo2] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[IntermediateSrlNo] [float] NULL,
	[IntermediateSrlDate] [datetime] NULL,
	[FinalSerialNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para1CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para1Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para2CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para2Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para3CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para3Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para4CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para4Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para5CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para5Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para6CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para6Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para7CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para7Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para8CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para8Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para9CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para9Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para10CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para10Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para11CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para11Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para12CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para12Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para13CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para13Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para14CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para14Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para15CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para15Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para16CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para16Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para17CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para17Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para18CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para18Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para19CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para19Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para20CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para20Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para21CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para21Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para22CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para22Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para23CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para23Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para24CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para24Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para25CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para25Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para26CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para26Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para27CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para27Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para28CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para28Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para29CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para29Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para30CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para30Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para31CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para31Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para32CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para32Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para33CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para33Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para34CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para34Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para35CodeOp10] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para35Op10] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para1CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para1FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para2CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para2FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para3CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para3FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para4CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para4FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para5CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para5FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para6CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para6FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para7CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para7FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para8CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para8FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para9CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para9FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para10CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para10FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para11CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para11FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para12CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para12FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para13CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para13FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para14CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para14FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para15CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para15FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para16CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para16FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para17CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para17FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para18CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para18FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para19CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para19FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para20CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para20FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para21CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para21FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para22CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para22FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para23CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para23FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para24CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para24FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para25CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para25FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para26CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para26FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para27CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para27FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para28CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para28FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para29CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para29FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para30CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para30FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para31CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para31FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para32CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para32FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para33CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para33FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para34CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para34FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para35CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para35FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para36CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para36FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para37CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para37FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para38CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para38FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para39CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para39FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para40CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para40FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para41CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para41FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para42CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para42FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para43CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para43FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para44CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para44FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para45CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para45FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para46CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para46FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para47CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para47FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para48CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para48FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para49CodeFS] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Para49FS] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleNo] [float] NULL,
	[ReadingSerialNo] [float] NULL
	) ON [PRIMARY]
 

	
CREATE TABLE [dbo].[TempHistoryReading] (
	[Field1] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field2] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field3] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field4] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field5] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field6] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field7] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field8] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field9] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field10] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field11] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field12] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field13] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field14] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field15] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field16] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Field17] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[RecordCounter] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempHistorySummary] (
	[jobSerialno] [float] NULL ,
	[SampleSize] [smallint] NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[UCLXBar] [float] NULL ,
	[LCLXBar] [float] NULL ,
	[UCLr] [float] NULL ,
	[LCLr] [float] NULL ,
	[LCLs] [float] NULL ,
	[UCLs] [float] NULL ,
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[PartParacode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[partparadescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[processdescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[uomdescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SubGroupSize] [int] NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[numberofreadings] [float] NULL ,
	[mean] [float] NULL ,
	[stddeviation] [float] NULL ,
	[Rbar] [float] NULL ,
	[xdoublebar] [float] NULL ,
	[stddeviation1] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RecalcLimitAfterSamples] [float] NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfTrend] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempJob](
	[WorkOrderNo] [nvarchar](30) NOT NULL,
	[WorkOrderDate] [datetime] NOT NULL,
	[StationNo] [nvarchar](50) NOT NULL,
	[MachineNo] [nvarchar](15) NOT NULL,
	[PartNo] [nvarchar](20) NOT NULL,
	[ProcessCode] [nvarchar](6) NOT NULL,
	[ServerId] [nvarchar](15) NULL,
	[QapProcessSeqNo] [smallint] NULL,
	[JobSerialno] [float] NOT NULL,
	[JobStartDate] [datetime] NULL,
	[BatchNo] [nvarchar](8) NOT NULL,
	[ReworkInd] [nvarchar](1) NULL,
	[JobStartTime] [nvarchar](11) NOT NULL,
	[JobCloseDate] [datetime] NULL,
	[BatchDate] [datetime] NULL,
	[JobClosetime] [nvarchar](11) NULL,
	[ProducedQty] [float] NULL,
	[ReworkOnJobSerialNo] [float] NULL,
	[CreatedBy] [nvarchar](6) NOT NULL,
	[ReworkSerialNo] [nvarchar](3) NULL,
	[ByPiece] [nvarchar](1) NULL,
	[ImportedJob] [nvarchar](1) NULL,
	[LotNumber] [nvarchar](1) NULL,
	[SINGLEINSTRUMENT] [nvarchar](1) NULL,
	[SINGLESWITCH] [nvarchar](1) NULL,
 CONSTRAINT [aaaaaHJob_PK] PRIMARY KEY NONCLUSTERED 
(
	[WorkOrderNo] ASC,
	[WorkOrderDate] ASC,
	[StationNo] ASC,
	[MachineNo] ASC,
	[PartNo] ASC,
	[ProcessCode] ASC,
	[JobSerialno] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

 


CREATE TABLE [dbo].[TempJobSample](
	[JobStartDate] [datetime] NOT NULL,
	[JobStartTime] [nvarchar](11) NOT NULL,
	[PartParaCode] [nvarchar](6) NOT NULL,
	[SampleNo] [float] NOT NULL,
	[JobSerialno] [float] NOT NULL,
	[PartParaType] [nvarchar](1) NOT NULL,
	[SetFault] [nvarchar](1) NULL,
	[DisposalActionTakenInd] [nvarchar](1) NULL,
	[ReworkInd] [nvarchar](1) NULL,
	[ReadingMode] [nvarchar](1) NULL,
	[SampleDate] [datetime] NULL,
	[SampleTime] [nvarchar](11) NULL,
	[DecisionTakenDate] [datetime] NULL,
	[DecisionTakenTime] [nvarchar](11) NULL,
	[DecisionQty] [float] NULL,
	[XBar] [float] NULL,
	[UCLXBarValue] [float] NULL,
	[LCLXBarValue] [float] NULL,
	[StdDeviation] [float] NULL,
	[SampleRange] [float] NULL,
	[ReworkSeqNo] [smallint] NULL,
	[SubGroupSize] [int] NULL,
	[DecisionExplanation] [nvarchar](100) NULL,
	[Operator] [nvarchar](6) NULL,
	[ShiftCode] [nvarchar](6) NULL,
	[DecisionTakenBy] [nvarchar](6) NULL,
	[ReworkProcessCode] [nvarchar](6) NULL,
	[HomogenizationInd] [nvarchar](1) NULL,
	[AssignableCause] [nvarchar](50) NULL,
	[MachineNo] [nvarchar](15) NOT NULL,
	[HomogenizedDate] [datetime] NULL,
	[HomogenizedTime] [datetime] NULL,
	[DieCode] [nvarchar](10) NULL,
	[SupervisorCode] [nvarchar](6) NULL,
 CONSTRAINT [aaaaaHJobSample_PK] PRIMARY KEY NONCLUSTERED 
(
	[JobSerialno] ASC,
	[PartParaCode] ASC,
	[SampleNo] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

 

CREATE TABLE [dbo].[TempJobReading](
	[ReadingSerialNo] [smallint] NOT NULL,
	[JobStartDate] [datetime] NOT NULL,
	[JobStartTime] [nvarchar](11) NOT NULL,
	[PartParaCode] [nvarchar](6) NOT NULL,
	[SampleNo] [float] NOT NULL,
	[JobSerialno] [float] NOT NULL,
	[ReadingDate] [datetime] NULL,
	[ReadingTime] [nvarchar](11) NULL,
	[Reading] [float] NOT NULL,
	[SubGroupSize] [int] NULL,
	[ShiftCode] [nvarchar](6) NULL,
	[Grade] [nvarchar](2) NULL,
	[Variation] [float] NULL,
	[ComponentNo] [nvarchar](20) NULL,
	[IntermediateSrlNo] [float] NULL,
	[IntermediateSrlDate] [datetime] NULL,
	[RollNo] [nvarchar](60) NULL,
	[BatchNo] [nvarchar](20) NULL,
	[HomogenizationInd] [nvarchar](1) NULL,
	[DateCode] [nvarchar](10) NULL,
	[OPERATOR] [nvarchar](6) NULL,
	[READINGMODE] [nvarchar](1) NULL,
 CONSTRAINT [aaaaaHJobReading_PK] PRIMARY KEY NONCLUSTERED 
(
	[JobSerialno] ASC,
	[PartParaCode] ASC,
	[SampleNo] ASC,
	[ReadingSerialNo] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

 


CREATE TABLE [dbo].[TempJobParameter](
	[WorkOrderNo] [nvarchar](30) NOT NULL,
	[WorkOrderDate] [datetime] NOT NULL,
	[StationNo] [nvarchar](50) NOT NULL,
	[PartNo] [nvarchar](20) NOT NULL,
	[ProcessCode] [nvarchar](6) NOT NULL,
	[JobSerialno] [float] NOT NULL,
	[MachineNo] [nvarchar](15) NOT NULL,
	[PartParaCode] [nvarchar](6) NOT NULL,
	[ServerId] [nvarchar](15) NOT NULL,
	[BatchNo] [nvarchar](8) NULL,
	[JobStartDate] [datetime] NULL,
	[QapProcessSeqNo] [smallint] NULL,
	[SetCpPpkInd] [nvarchar](1) NULL,
	[SetControlLimit] [nvarchar](1) NULL,
	[FinalInspProcCompInd] [nvarchar](1) NULL,
	[FinalInspectionInd] [nvarchar](1) NULL,
	[ReadingMode] [nvarchar](1) NULL,
	[PartParaType] [nvarchar](1) NOT NULL,
	[JobStartTime] [nvarchar](11) NOT NULL,
	[ReWorkOnJobSerialNo] [int] NULL,
	[Cp] [float] NULL,
	[Cpk] [float] NULL,
	[pp] [float] NULL,
	[Ppk] [float] NULL,
	[LCLXBar] [float] NULL,
	[UCLXBar] [float] NULL,
	[LSLValue] [float] NULL,
	[USLValue] [float] NULL,
	[LCLR] [float] NULL,
	[UCLR] [float] NULL,
	[LCLS] [float] NULL,
	[UCLS] [float] NULL,
	[SampleSize] [smallint] NULL,
	[MinLotSize] [smallint] NULL,
	[SampleSetNo] [smallint] NULL,
	[FinalInspSetNo] [smallint] NULL,
	[ActiveChannel] [smallint] NULL,
	[InstrumentNo] [nvarchar](15) NULL,
	[InstrumentType] [nvarchar](6) NULL,
	[LocationCode] [nvarchar](6) NULL,
	[UomCode] [nvarchar](6) NOT NULL,
	[FinalInspectionID] [nvarchar](5) NULL,
	[ReWorkSerialNo] [nvarchar](3) NULL,
	[BatchDate] [datetime] NULL,
	[SubGroupSize] [int] NULL,
	[Fixturecode] [nvarchar](6) NULL,
	[sequenceno] [nvarchar](3) NULL,
	[formulae] [nvarchar](250) NULL,
	[mastervalue] [float] NULL,
	[FixtureSeqNo] [nvarchar](3) NULL,
	[SerialPort] [nvarchar](1) NULL,
	[ParallelPort] [nvarchar](1) NULL,
	[dumpdynamic] [nvarchar](1) NULL,
	[CalibrationValue] [float] NULL,
	[DNPattern] [nvarchar](1) NULL,
	[CLCalculateSpecifyInd] [nvarchar](1) NULL,
	[CheckSpecLmtInd] [nvarchar](1) NULL,
	[UCLRInitValue] [float] NULL,
	[LCLRInitValue] [float] NULL,
	[NominalValue] [float] NULL,
	[LCLInitXbar] [float] NULL,
	[UCLInitXbar] [float] NULL,
	[PrecisionInd] [nvarchar](1) NULL,
	[RepetativeReCalc] [nvarchar](1) NULL,
	[ReCalcLimitAfterSamples] [smallint] NULL,
	[CentPercentInspInd] [nvarchar](1) NULL,
	[OneSidedInd] [nvarchar](1) NULL,
	[BestSample] [float] NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL,
	[MappedSequence] [smallint] NULL,
	[InstrumentAddress] [smallint] NULL,
	[ColorStatus] [nvarchar](1) NULL,
	[CpkPpkLastSamples] [smallint] NULL,
	[LastCp] [float] NULL,
	[LastCpk] [float] NULL,
	[LastPp] [float] NULL,
	[LastPpk] [float] NULL,
	[AckChannelNo] [smallint] NULL,
 CONSTRAINT [aaaaaHJobParameter_PK] PRIMARY KEY NONCLUSTERED 
(
	[WorkOrderNo] ASC,
	[WorkOrderDate] ASC,
	[StationNo] ASC,
	[PartNo] ASC,
	[ProcessCode] ASC,
	[JobSerialno] ASC,
	[MachineNo] ASC,
	[PartParaCode] ASC,
	[ServerId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

 

SET QUOTED_IDENTIFIER ON
 

CREATE TABLE [dbo].[TempCorrectiveAction](
	[JobStartDate] [datetime] NOT NULL,
	[TargetDateToComplete] [datetime] NULL,
	[JobStartTime] [nvarchar](11) NOT NULL,
	[ResponsibilityAssignedDate] [datetime] NULL,
	[CorrectiveActionTakenDate] [datetime] NULL,
	[WorkOrderDate] [datetime] NOT NULL,
	[JobSerialno] [float] NOT NULL,
	[SampleNo] [float] NOT NULL,
	[ResponsibilityAssignedTo] [nvarchar](6) NULL,
	[ResponsibilityAssignedBy] [nvarchar](6) NULL,
	[PartParaCode] [nvarchar](6) NOT NULL,
	[DisposalActionCode] [nvarchar](3) NULL,
	[CorrectiveAction] [nvarchar](100) NULL,
	[CorrectiveActionTakenBy] [nvarchar](6) NULL,
	[RootCause] [nvarchar](30) NULL,
	[PartNo] [nvarchar](20) NOT NULL,
	[WorkOrderNo] [nvarchar](30) NOT NULL,
	[ProcessCode] [nvarchar](6) NOT NULL,
	[CorrectiveActionSrlNo] [float] NULL,
	[ResponsibilityDomain] [nvarchar](1) NULL,
	[RemarksForCompOfCA] [nvarchar](200) NULL,
	[SampleDate] [datetime] NULL,
	[SampleTime] [nvarchar](11) NULL,
	[MachineNo] [nvarchar](15) NOT NULL,
	[StationNo] [nvarchar](50) NULL,
	[BatchNo] [nvarchar](8) NULL,
	[Levels] [nvarchar](10) NULL,
	[Trend] [smallint] NOT NULL,
	[CorrectiveActionTakenTime] [nvarchar](11) NULL,
	[Manned] [nvarchar](1) NULL,
	[TrendSampleNos] [nvarchar](100) NULL,
	[EmailTag] [nvarchar](1) NULL,
	[SMSTag] [nvarchar](1) NULL,
	[SHIFTCODE] [nvarchar](6) NULL,
 CONSTRAINT [aaaaaHCorrectiveAction1_PK] PRIMARY KEY NONCLUSTERED 
(
	[WorkOrderDate] ASC,
	[JobSerialno] ASC,
	[SampleNo] ASC,
	[PartParaCode] ASC,
	[PartNo] ASC,
	[WorkOrderNo] ASC,
	[ProcessCode] ASC,
	[MachineNo] ASC,
	[Trend] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

 

CREATE TABLE [dbo].[TempLinearity] (
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Description] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ReadingMode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfReadings] [int] NULL ,
	[ProcessVariation] [float] NULL ,
	[StudyDate] [datetime] NULL ,
	[EndDate] [datetime] NULL ,
	[ReadingSerialNo] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo6] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LocalHostname] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Counters] [int] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempProduction] (
	[ShiftDate] [datetime] NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProductionQty] [float] NULL ,
	[PartName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Colour] [int] NULL ,
	[UserName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TargetQuantity] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempSummary] (
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleSize] [smallint] NULL ,
	[LSLValue] [float] NULL ,
	[LCLxbar] [float] NULL ,
	[LCLr] [float] NULL ,
	[USLValue] [float] NULL ,
	[UCLxbar] [float] NULL ,
	[LCLs] [float] NULL ,
	[UCLs] [float] NULL ,
	[JobSerialNo] [float] NULL ,
	[JobStartDate] [datetime] NULL ,
	[SubGroupSize] [int] NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UCLr] [float] NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[NumberOfReadings] [float] NULL ,
	[Mean] [float] NULL ,
	[StdDeviation] [float] NULL ,
	[RBar] [float] NULL ,
	[XDoubleBar] [float] NULL ,
	[StdDeviation1] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfTrend] [smallint] NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempTLMModelWise] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegroundSerialNo] [smallint] NULL ,
	[PartSerialNo] [int] NULL ,
	[ProducedQty] [float] NULL ,
	[Status] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[IssuedDate] [datetime] NULL ,
	[Usercode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[parachange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempTLMModelWiseReport] (
	[Model] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Machine] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Operation] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegroundSrNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ActualToolLife] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Status] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ExpToolLife] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PerToolLife] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Remarks] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para1] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para2] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para3] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para4] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para5] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para6] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para7] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para8] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para9] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para10] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Sequence] [float] NULL ,
	[PartSerialNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SubRootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolChangeDate] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ModelCloseNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempTLMOperatwise] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegroundSerialNo] [float] NULL ,
	[ProducedQty] [float] NULL ,
	[ExpectedLife] [float] NULL ,
	[Description] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PercentToolLife] [float] NULL ,
	[ToolWisePercentLife] [float] NULL ,
	[PercentOfFullToolLife] [float] NULL ,
	[RootCause] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempTLMParameter] (
	[Model] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Machineno] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Processcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegroundSerialNo] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ActualToolLife] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Status] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ExpToolLife] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[paraserialno] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[partserialno] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TotalQuantity] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para1] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para2] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para3] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para4] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para5] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para6] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para7] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para8] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para9] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Para10] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Sequence] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ParaChangeDate] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[stationno] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TempTLMToolIssue] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegroundSerialNo] [float] NULL ,
	[ProducedQty] [float] NULL ,
	[ExpectedLife] [float] NULL ,
	[ToolTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TooltypeDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Balances] [float] NULL ,
	[PercentBalanceLife] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Tool] (
	[ToolTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NULL ,
	[Status] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[percentbalancelife] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolChange] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[OldToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ShiftProduction] [float] NULL ,
	[RootCauseCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ChangeStatus] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Remarks] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NewToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftDate] [datetime] NULL ,
	[Shiftcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolChangeDate] [datetime] NOT NULL ,
	[regroundserialno] [smallint] NOT NULL ,
	[SubRootCauseCode] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolChangeHist] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[OldToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[regroundserialno] [smallint] NOT NULL ,
	[PartSerialNo] [int] NULL ,
	[ShiftProduction] [float] NULL ,
	[RootCauseCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ChangeStatus] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Remarks] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NewToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ShiftDate] [datetime] NULL ,
	[Shiftcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ToolChangeDate] [datetime] NOT NULL ,
	[SubRootCauseCode] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolIssue] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[ProducedQty] [float] NULL ,
	[ParameterValue] [float] NULL ,
	[Status] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[IssuedDate] [datetime] NULL ,
	[Usercode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[parachange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolIssueHist] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[PartSerialNo] [int] NOT NULL ,
	[ProducedQty] [float] NULL ,
	[Status] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[IssuedDate] [datetime] NULL ,
	[Usercode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[parachange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolIssueParameterHist] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[PartSerialNo] [int] NOT NULL ,
	[ParaCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParameterValue] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolIssueParameters] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[ParaCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParameterValue] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolLifeExceptions] (
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegroundSerialNo] [smallint] NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Shiftdate] [datetime] NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Expectedlife] [int] NULL ,
	[ExceededQty] [float] NULL ,
	[SupervisorCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Remark] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Currentlife] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolParaChange] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[ParaSerialNo] [smallint] NOT NULL ,
	[ShiftQuantity] [float] NULL ,
	[TotalQuantity] [float] NULL ,
	[ParaChangeDate] [datetime] NULL ,
	[Usercode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolParaChangeDetail] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[ParaSerialNo] [smallint] NOT NULL ,
	[ParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParameterValue] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolParaChangeDtlHist] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[PartSerialNO] [int] NOT NULL ,
	[ParaSerialNo] [smallint] NOT NULL ,
	[ParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParameterValue] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolParaChangeHist] (
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ToolCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[RegroundSerialNo] [smallint] NOT NULL ,
	[PartSerialNo] [int] NOT NULL ,
	[ParaSerialNo] [smallint] NOT NULL ,
	[ShiftQuantity] [float] NULL ,
	[TotalQuantity] [float] NULL ,
	[ParaChangeDate] [datetime] NULL ,
	[Usercode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolType] (
	[TooltypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[TooltypeDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RegroundNo] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ToolTypeParameter] (
	[ToolTypeCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ParaCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[TrendForXBar] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[BatchNo] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UpMeanRuns] [smallint] NULL ,
	[DownMeanRuns] [smallint] NULL ,
	[UpRangeRuns] [smallint] NULL ,
	[DownRangeRuns] [smallint] NULL ,
	[GreaterThanMeanRuns] [smallint] NULL ,
	[LessThanMeansRuns] [smallint] NULL ,
	[GreaterThanRangeRuns] [smallint] NULL ,
	[LessThanRangeRuns] [smallint] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Trends] (
	[Trend] [int] NULL ,
	[TrendDescription] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CustomisedMessage] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RootCauseCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Email] [nchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SMS] [nchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[UDetail] (
	[ReadingNo] [smallint] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[Reading] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[UHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[UnitOfMeasurement] (
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UomDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Users] (
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[DepartmentCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ActiveInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PasswordExpiryDate] [datetime] NULL ,
	[TicketNo] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RoleID] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Password] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UserName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[WoQapParameter] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[QapProcessSeqNo] [smallint] NULL ,
	[OneSidedInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CriticalInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrecisionInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CentPercentInspInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RepetativeReCalc] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MeasuringType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CLCalculateSpecifyInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CheckSpecLmtInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NumberOfSubGroups] [int] NULL ,
	[UCLRInitValue] [float] NULL ,
	[LCLRInitValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[USLValue] [float] NULL ,
	[Settingvalue] [float] NULL ,
	[NominalValue] [float] NULL ,
	[BestSample] [float] NULL ,
	[LCLInitXbar] [float] NULL ,
	[UCLInitXbar] [float] NULL ,
	[Chart] [float] NULL ,
	[SampleSize] [smallint] NULL ,
	[ActiveChannel] [smallint] NULL ,
	[SampleFrequency] [smallint] NULL ,
	[ReCalcLimitAfterSamples] [smallint] NULL ,
	[SubgroupSize] [int] NULL ,
	[PartParaSeqNo] [smallint] NULL ,
	[InstrumentNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[FinalInspectionID] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[InterFaceCode] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleUnit] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CalibrationValue] [float] NULL ,
	[gainfactor] [float] NULL ,
	[InstrumentType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[NoOfReadingsForCpk] [int] NULL,
	[AbsNominalValue] [float] NULL ,
	[Formulae] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[dumpdynamic] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MappedSequence] [int] NULL,
	[InstrumentAddress] [smallint] NULL,
    [CpkPpkLastSamples] [smallint] DEFAULT 0
) ON [PRIMARY]
 

CREATE TABLE [dbo].[WoQapProcess] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[QapProcessSeqNo] [smallint] NULL ,
	[ApplicabilityInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FinalInspectionProcessInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PreparedBy] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LotNumber] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[WorkOrder] (
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[WorkOrderDate] [datetime] NOT NULL ,
	[WorkOrderType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TargetQty] [float] NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XBarRDetail] (
	[SampleNo] [float] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[XBar] [float] NULL ,
	[SampleRange] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[HomogenizationInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[AssignableCause] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[HomogenizedDate] [datetime] NULL ,
	[HomogenizedTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XBarRHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SampleSize] [smallint] NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[UCLXBar] [float] NULL ,
	[LCLXBar] [float] NULL ,
	[UCLr] [float] NULL ,
	[LCLr] [float] NULL ,
	[XDoubleBar] [float] NULL ,
	[RBar] [float] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UOMDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[A2] [real] NULL ,
	[D3] [real] NULL ,
	[D4] [real] NULL ,
	[HomogenizeInd] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[SD] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XBarSDetail] (
	[SampleNo] [float] NOT NULL ,
	[ChartSerialNumber] [smallint] NULL ,
	[XBar] [float] NULL ,
	[SampleRange] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XBarSHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SampleSize] [smallint] NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[UCLXBar] [float] NULL ,
	[LCLXBar] [float] NULL ,
	[UCLs] [float] NULL ,
	[LCLs] [float] NULL ,
	[XDoubleBar] [float] NULL ,
	[SBar] [float] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UOMDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Cp] [float] NULL ,
	[Cpk] [float] NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pp] [float] NULL ,
	[Ppk] [float] NULL ,
	[SD] [float] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XBarSettings] (
	[PointsOutsideLimitMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PointsOutsideLimitRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsUpMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsDownMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsUpRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsDownRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsRuns] [int] NULL ,
	[GreaterThanMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LessThanMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GreaterThanMeanRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LessThanMeanRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Runs] [int] NULL ,
	[MiddleThirdMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MiddleThirdRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ZoneAMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ZoneBMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ZoneCMean] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ZoneARange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ZoneBRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ZoneCRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ErrorCodeEnable] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsUpMeanLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsDownMeanLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsUpRangeLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsDownRangeLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TrendsRunsLevel2] [smallint] NULL ,
	[GreaterThanMeanLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LessThanMeanLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GreaterThanMeanRangeLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LessThanMeanRangeLevel2] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RunsLevel2] [smallint] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LevelOneMandatory] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LevelTwoMandatory] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CPKLimit] [float] NULL ,
	[PPKLimit] [float] NULL ,
	[RaiseCpkTrend] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RaisePpkTrend] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Manned] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XDetail] (
	[ReadingNo] [smallint] NOT NULL ,
	[ChartSerialNumber] [smallint] NOT NULL ,
	[XValue] [float] NULL ,
	[SampleDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OUTSPECLABEL] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BELOWOUTSPECLABEL] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SampleNo] [float] NULL ,
	[RollNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[CpkValue] [float] NULL ,
	[PpValue] [float] NULL ,
	[PpkValue] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SampleSize] [smallint] NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[XBar] [float] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UOMDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[LCLXBar] [float] NULL ,
	[UCLXBar] [float] NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XMRDetail] (
	[ReadingNo] [smallint] NOT NULL ,
	[ChartSerialNumber] [smallint] NULL ,
	[XValue] [float] NULL ,
	[MRValue] [float] NULL ,
	[ReadingDateTime] [datetime] NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[XMRHeader] (
	[ChartSerialNumber] [smallint] NOT NULL ,
	[SampleSize] [smallint] NULL ,
	[USLValue] [float] NULL ,
	[LSLValue] [float] NULL ,
	[UCLXBar] [float] NULL ,
	[LCLXBar] [float] NULL ,
	[UCLmr] [float] NULL ,
	[LCLmr] [float] NULL ,
	[XBar] [float] NULL ,
	[MRBar] [float] NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[WorkOrderNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[UOMDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[fixture] (
	[fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[fixturetype] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[fixturename] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Manufacturer] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Calibrationdate] [datetime] NULL ,
	[Model] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[locationcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[specification] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[createdby] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[creationdate] [datetime] NULL ,
	[CalibrationInterval] [smallint] NULL ,
	[BMPFile] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[fixtureparameter] (
	[fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[partparacode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[fixtureprobes] (
	[fixturecode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[probeno] [smallint] NOT NULL ,
	[ProbeRange] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[tempreject] (
	[jobstartdate] [datetime] NULL ,
	[partno] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[processcode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[machineno] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[reworkprocesscode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NoOfPieces] [smallint] NULL ,
	[disposalactioncode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[rateofrawmaterial] [float] NULL ,
	[RawMaterialCostPerPiece] [float] NULL ,
	[costrate] [float] NULL ,
	[repaircost] [float] NULL ,
	[ProductionCapacityPerHr] [float] NULL ,
	[rateperhr] [float] NULL ,
	[costofProcessing] [float] NULL ,
	[TotalCost] [float] NULL ,
	[partname] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[processdescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Description] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ChiSquare] (
	[DegreeOfFreedom] [int] NULL,
	[ConfidenceLevel] [float] NULL,
	[ChiSquareVal] [float] NULL
)
 

CREATE TABLE [dbo].[ZValue] (
	[Z] [float] NULL,
	[X] [float] NULL,
	[StdNormalProb] [float] NULL
)
 


CREATE TABLE [dbo].[D2Table] (
	[NoOfSubgroups] [int] NULL,
	[SubgroupSize] [int] NULL,
	[DegreeOfFreedom] [float] NULL,
	[d2] [float] NULL
)
 

CREATE TABLE [dbo].[TTABLE] (
	[DegreeOfFreedom ] [int] NULL,
	[ConfidenceInterval ] [float] NULL,
	[TValue] [float] NULL
)
 

CREATE TABLE [dbo].[GAUGECALIBRATION] (
	[INSTRUMENTNO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[CALIBRATIONDATE][datetime] NOT NULL,CALIBRATIONDUEDATE [datetime] NULL,
	[COMPANYNAME] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[CALIBRATEDBY] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[REMARKS] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MODIFIEDBY] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[MODIFIEDDATE][datetime] NULL,
	[REFERENCESTDUSED] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [GAUGEACCEPTED] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [CALIBRATIONREPORTNO] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 


CREATE TABLE [dbo].[OutOfSpecJobReading] (
	[ReadingSerialNo] [smallint] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Reading] [float] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Grade] [nvarchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Variation] [float] NULL ,
	[ComponentNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[IntermediateSrlNo] [float] NULL ,
	[IntermediateSrlDate] [datetime] NULL ,
	[RollNo] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
	) ON [PRIMARY]

 


CREATE TABLE [dbo].[HistOutOfSpecJobReading] (
	[ReadingSerialNo] [smallint] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Reading] [float] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Grade] [nvarchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Variation] [float] NULL ,
	[ComponentNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[IntermediateSrlNo] [float] NULL ,
	[IntermediateSrlDate] [datetime] NULL ,
	[RollNo] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
	) ON [PRIMARY]

 



CREATE TABLE [dbo].[HistPurgingOutOfSpecJobReading] (
	[ReadingSerialNo] [smallint] NOT NULL ,
	[JobStartDate] [datetime] NOT NULL ,
	[JobStartTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[SampleNo] [float] NOT NULL ,
	[JobSerialno] [float] NOT NULL ,
	[ReadingDate] [datetime] NULL ,
	[ReadingTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Reading] [float] NOT NULL ,
	[SubGroupSize] [int] NULL ,
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Grade] [nvarchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Variation] [float] NULL ,
	[ComponentNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[IntermediateSrlNo] [float] NULL ,
	[IntermediateSrlDate] [datetime] NULL ,
	[RollNo] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
	) ON [PRIMARY]

 


CREATE TABLE [dbo].[SpliceDetails] (
        [SpliceDate] [datetime] NOT NULL ,
        [SpliceTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [MaterialCode] [nvarchar] (18) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [RollNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
        ) ON [PRIMARY]

 



CREATE TABLE [dbo].[RollBatchDetail] (
                [MaterialCode] [nvarchar] (18) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
		[Width] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
		[BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[RollNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[Campaign] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[Procorder] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[MachineNo] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[MCode] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
        ) ON [PRIMARY]

 

CREATE TABLE [dbo].[ConfigureFolderPath] (
        [PCSFolderpath] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [ScadaFolderpath] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [LaminationScadaFolderPath] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [ScanningFrequency] [smallint] NOT NULL) 

CREATE TABLE [dbo].[ZipDetail] (
        [ZipMonth] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [ZipYear] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
		[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
		[ZipDate] [datetime] NOT NULL,
		[ZipTime] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
 )
    
		 
 
 
CREATE TABLE [dbo].[LocationParameter] (
        [LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [PartParaCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
		) ON [PRIMARY]
 

CREATE TABLE [dbo].[LocationEmployee] (
        [LocationCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
        [ShiftDate] [datetime] NOT NULL, 
	[ShiftCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ShiftStartTime] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ShiftEndTime] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[UserCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
		) ON [PRIMARY]
 


CREATE TABLE [dbo].[TempSearchOperator] (
        [WorkOrderno] [nvarchar] (30) ,
        [PartNo] [nvarchar] (20), 
	[ProcessCode] [nvarchar] (6),
	[Machineno] [nvarchar] (15) ,
	[Partparacode] [nvarchar] (6)  ,
	[ReadingDate] [datetime]  NOT NULL,
	[ReadingTime] [nvarchar] (11), 
	[Reading] [float],
	[Locationcode] [nvarchar] (6),
	[UserCode] [nvarchar] (100) , 
	[StationNo] [nvarchar] (50), 
	[PartParaDescription] [nvarchar] (30), 
	[sequenceno][nvarchar](3))

 

CREATE TABLE [dbo].[PPRREPORT] (
		[JobSerialno] [float] NOT NULL,
		[PartNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[Partparacode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[Reading] [float] NULL ,
        [RollNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
        [BatchNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, 
		[ProcessCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[SequenceNo] [int] NULL,
		[ReadingDate] [datetime] NULL ,
		[StationNo] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
		[UomCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
		) ON [PRIMARY]
 

CREATE TABLE [dbo].[ConfigurableParameter] (
	[RejectReadingPercentage] [float] NULL,
    [DisplayCpk] [nvarchar] (13) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
 



CREATE TABLE [dbo].[TemplateForParameter] (
	[Partparacode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ConfigureSMS](
	[UserName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Password] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[SenderID1] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[SenderID2] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[Email](
	[Name] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[EmailId] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SMSNumber] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[ShiftChgSMS] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[CdmaOrGsm] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[Category] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[DesktopFrequency] [int] NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ConfigureHostPort](
	[UserName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SenderEmailId] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[HostName] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Port] [smallint] NOT NULL,
	[Password] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ShiftUser](
	[ShiftCode] [nvarchar](6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[NAME] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
) ON [PRIMARY]
 

CREATE TABLE [dbo].[UserMachineDetail](
	[NAME] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[MachineNo] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
) ON [PRIMARY]
 

CREATE TABLE [dbo].[UserMachineMaster](
	[NAME] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[AllShiftReport] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[ShiftReport] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[RegularEmail] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[RegularSMS] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ControlLimitChange](
	[JOBSERIALNO] [float] NOT NULL ,[PARTPARACODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[OLDUCLX] [float] NOT NULL,[NEWUCLX] [float] NOT NULL,
	[OLDLCLX] [float] NOT NULL,[NEWLCLX] [float] NOT NULL,
	[OLDUCLR] [float] NOT NULL,[NEWUCLR] [float] NOT NULL,
	[OLDLCLR] [float] NOT NULL,[NEWLCLR] [float] NOT NULL,
	[CLCHANGEDATE] [datetime] NULL,[CLCHANGETIME] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[USERCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,LastSampleNo [float] NOT NULL,
	[SRNO] [smallint] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[ReadingChange](
	[JOBSERIALNO] [float] NOT NULL ,[PARTPARACODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[SAMPLENO] [float] NOT NULL,[READINGSERIALNO] [smallint] NOT NULL,
	[OLDREADING] [float] NOT NULL,[NEWREADING] [float] NOT NULL ,
	[READINGCHANGEDATE] [datetime] NULL,[READINGCHANGETIME] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[USERCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SRNO] [smallint] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [dbo].[INSTCALIBRATIONMASTER](
    [INSTRUMENTNO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [CALSTEPCODE] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [LSL] [float] NOT NULL,
    [USL] [float] NOT NULL
)ON [PRIMARY]
 

CREATE TABLE [dbo].[INSTRUMENTCALHISTORYDETAIL](
    [INSTRUMENTNO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [CALSTEPCODE] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[CALIBRATIONDATE] [datetime] NOT NULL,
	[WEARVALUE] [float] NOT NULL
)
 

CREATE TABLE  [dbo].[WEARHEADER] ([CHARTSERIALNUMBER] [smallint] NOT NULL,[LSLVALUE] [float] NOT NULL,
	[USLVALUE] [float] NOT NULL, [XBAR] [float] NOT NULL,[YBAR] [float] NOT NULL,
	[CALIBRATIONFREQUENCY] [smallint] NOT NULL, [VALUEOFA] [float] NOT NULL,[VALUEOFB] [float] NOT NULL,
	[SUMOFXIYI] [float] NOT NULL, [SUMOFXISQR] [float] NOT NULL,
	[PREDFAILUREMINDATE] [DATETIME] NOT NULL, [PREDFAILUREMAXDATE] [DATETIME] NOT NULL,
	[STATIONNO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
)
 

CREATE TABLE [DBO].[WEARDETAIL] ([CHARTSERIALNUMBER] [smallint] NOT NULL, [WEARVALUEY] [float] NOT NULL,
	[CALDATEX] [DATETIME] NOT NULL, [TOTALDAYS] [smallint] NOT NULL,
	[YESTIMATE] [float] NOT NULL, [XI_XBAR] [float] NOT NULL,
	[YI_YBAR FLOAT] [float] NOT NULL,[SQR_XI_XBAR] [float] NOT NULL,
	[MULTXI_XBAR_YI_YBAR] [float] NOT NULL,
	[STATIONNO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
)
 


CREATE TABLE [DBO].[PASSJOBNOHANDLE] (
	[JOBSRNONSCREENHANDLE] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[LSCREENHANDLE] [float] 
) ON [PRIMARY]
 

CREATE TABLE [DBO].[LASTREADINGNO] (
	[INSTRUMENTNO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[INSTRUMENTADDRESS] [smallint] NOT NULL,
	[LASTREADINGNO] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[PLANTS] (
	[PLANTCODE] [smallint] NOT NULL,
	[PLANTNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[DIVISIONS] (
	[DIVCODE] [smallint] NOT NULL,
	[PLANTCODE] [smallint] NOT NULL,
	[DIVNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[UNITS] (
	[UNITCODE] [smallint] NOT NULL,	
	[PLANTCODE] [smallint] NOT NULL,
	[DIVCODE] [smallint] NOT NULL,
	[UNITNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[CELLS] (
	[LOCATIONCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[PLANTCODE] [smallint] NOT NULL,
	[DIVCODE] [smallint] NOT NULL,
	[UNITCODE] [smallint] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[USERDETAIL] (
	[USERCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[PLANTCODE] [smallint] NOT NULL,
	[DIVCODE] [smallint] NOT NULL,
	[UNITCODE] [smallint] NOT NULL,
	[LOCATIONCODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[MACHINEEVENT] (
	[SRNO] [smallint] NOT NULL, 
	[MACHINENO] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[EVENTDATE] [datetime] NOT NULL,
	[EVENTTIME] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[EVENTCODE] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[STATUS] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[MACHINEEVENTDETAIL] (
	[SRNO] [smallint] NOT NULL, 
	[JOBSERIALNO] [float] NOT NULL,
	[PARTPARACODE] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,	
	[STATUS] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[CSVFILEDATE] (
	[FNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[FILEDATE] [datetime] NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[GRRRESULT] (
	[MINPERCENT] [FLOAT] NOT NULL,
	[MAXPERCENT] [FLOAT] NOT NULL,
	[RESULT] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[SCANUNSCANFILE] (
	[SHAREFOLDERNAME] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[FILEDATE] [datetime] NOT NULL,[FILETIME] [datetime] NOT NULL,
	[STATIONNO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[ALLFILE] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [SCANFILE] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [UNSCANFILE] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[PRESIDENT] ( 
    [PLANTCODE] [smallint] NOT NULL,
    [PRESIDENTCODE] [smallint] NOT NULL,
    [PRESIDENTNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[GMANAGER] ( 
    [PLANTCODE] [smallint] NOT NULL,
    [PRESIDENTCODE] [smallint] NOT NULL,
    [GMANAGERCODE] [smallint] NOT NULL,
    [GMANAGERNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[UMANAGER] ( 
    [PLANTCODE] [smallint] NOT NULL,
    [PRESIDENTCODE] [smallint] NOT NULL,
	[GMANAGERCODE] [smallint] NOT NULL,
	[UMANAGERCODE] [smallint] NOT NULL,
    [UMANAGERNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[UNITCODE] [smallint] NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[MAILSENDDATE] ( 
    [SENDDATE] [DATETIME] NOT NULL,
    [CATEGORY] [CHAR] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [USERNAME] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [PLANTCODE] [smallint] NULL,
    [PRESIDENTCODE] [smallint] NULL,
    [GMANAGERCODE] [smallint] NULL,
    [UMANAGERCODE] [smallint] NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[READINGDUMPTIME] (
    [FROMTIME] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[TOTIME] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
 

CREATE TABLE [DBO].[GenerateDll] (ParameterNo smallint, 
Sign smallint, 
Mode nvarchar(1), 
CRPresent nvarchar(1), 
LFPresent nvarchar(1), 
DataFrom smallint,
DataTo smallint, 
Formula nvarchar(50), 
Delimiter nvarchar(50))

 

CREATE TABLE [dbo].[DProduction](
                [Code] [float] NOT NULL,
                [ProductionDate] [datetime] NULL,
                [Shiftcode] [nvarchar](6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [PartNo] [nvarchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [MachineNo] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [ProducedQuantity] [int] NULL,
                [RejectionQuantity] [int] NULL,
CONSTRAINT [PK_DDProduction] PRIMARY KEY CLUSTERED 
(
                [Code] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


CREATE TABLE [dbo].[RejectionDetails](
                [Code] [numeric](18, 0) NOT NULL,
                [RejectionCode] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
                [RejectionQuantity] [int] NULL,
CONSTRAINT [PK_RejectionDetails] PRIMARY KEY CLUSTERED 
(
                [Code] ASC,
                [RejectionCode] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


CREATE TABLE [dbo].[ConfMeasureDetail](
                [StationNo] [nvarchar](60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [RowNo] [smallint] NULL,
                [UserDefLabel] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [SequenceNo] [int] NULL
) ON [PRIMARY]



CREATE TABLE [dbo].[ConfMeasureMaster](
                [StationNo] [nvarchar](60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [ParameterView] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [Serialized] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [VisibleReadingCount] [smallint] NULL,
                [TopToBottom] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [DashboardView] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [HeaderDb] [int] NULL,
                [EvenDb] [int] NULL,
                [OddDb] [int] NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[AuditLog](
                [TableName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [Code1] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [Code2] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [Code3] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [Code4] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [Code5] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [Code6] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [InsUpdDelFlag] [nchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [TimeStamp] [datetime] NULL,
                [UserId] [nvarchar](6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
                [ScreenName] [nvarchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[JobParameterDetails](
                [JobSerialno] [float] NOT NULL,
                [SampleNo] [float] NOT NULL,
                [PartParaCode] [nvarchar](6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
                [LCLXBar] [float] NULL,
                [UCLXBar] [float] NULL,
                [LCLR] [float] NULL,
                [UCLR] [float] NULL,
                [Cp] [float] NULL,
                [Cpk] [float] NULL,
                [pp] [float] NULL,
                [Ppk] [float] NULL,
                [LCLS] [float] NULL,
                [UCLS] [float] NULL,
                [LastCp] [float] NULL,
                [LastCpk] [float] NULL,
                [LastPp] [float] NULL,
                [LastPpk] [float] NULL,
                [ColorStatus] [nvarchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[ScanTableData](
			[TableNames] [nvarchar](50) NOT NULL,
			[LastScantime] [datetime] NULL,
			CONSTRAINT [PK_ScanTableData] PRIMARY KEY CLUSTERED 
			([TableNames] ASC)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, 
			IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
			) ON [PRIMARY]


ALTER TABLE [dbo].[Batch] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaBatch_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[BatchNo],
		[WorkOrderNo],
		[WorkOrderDate]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[BiasMapping] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__BiasM__17C286CF] DEFAULT (0) FOR [BiasMapSrNo],
	CONSTRAINT [DF__Temporary__NoOfR__1A9EF37A] DEFAULT (0) FOR [NoOfReadings],
	CONSTRAINT [DF__Temporary__Maste__1C873BEC] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [DF__Temporary__Preci__1D7B6025] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__BiasV__2057CCD0] DEFAULT (0) FOR [BiasValue],
	CONSTRAINT [DF__Temporary__Chann__214BF109] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__22401542] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaBiasMapping_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[BiasMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[BiasReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__BiasM__5E1FF51F] DEFAULT (0) FOR [BiasMapSrNo],
	CONSTRAINT [DF__Temporary__Readi__60083D91] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__60FC61CA] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaBiasReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[BiasMapSrNo],
		[ReadingSerialNo],
		[SubGroupNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[GaugeCalibration] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaGaugeCalibration_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[InstrumentNo],
		[CalibrationDate]
	)  ON [PRIMARY] 
 


ALTER TABLE [dbo].[Company] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__OnLin__0AD2A005] DEFAULT (0) FOR [OnLineChartPoints],
	CONSTRAINT [DF__Temporary__First__0BC6C43E] DEFAULT (0) FOR [FirstCOMport],
	CONSTRAINT [DF__Temporary__ShowM__0CBAE877] DEFAULT (0) FOR [ShowMsgNMin]
 

ALTER TABLE [dbo].[CorrectiveAction] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Trend__33F4B129] DEFAULT (0) FOR [Trend],
	CONSTRAINT [aaaaaCorrectiveAction1_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[JobSerialno],
		[SampleNo],
		[PartParaCode],
		[PartNo],
		[WorkOrderNo],
		[ProcessCode],
		[MachineNo],
		[Trend]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Country] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaCountry_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[CountryCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[EventRemarks] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaEventRemarks_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[ReadingSerialNo],
		[PartParaCode],
		[SampleNo],
		[SrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgingEventRemarks] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistPurgingEventRemarks_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[ReadingSerialNo],
		[PartParaCode],
		[SampleNo],
		[SrNo]
	)  ON [PRIMARY] 
 


ALTER TABLE [dbo].[Customer] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaCustomer_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[CustomerCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[CustomerPart] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaCustomerPart_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[CustomerCode],
		[PartNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Department] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaDepartment_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[DepartmentCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[FixtureMapping] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Maste__603D47BB] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [aaaaaFixtureMapping_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[FixtureCode],
		[PartNo],
		[ProcessCode],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[GRRMapping] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__GRRMa__3C69FB99] DEFAULT (0) FOR [GRRMapSrNo],
	CONSTRAINT [DF__Temporary__Trial__3F466844] DEFAULT (0) FOR [TrialsFixed],
	CONSTRAINT [DF__Temporary__NoOfO__412EB0B6] DEFAULT (0) FOR [NoOfOperators],
	CONSTRAINT [DF__Temporary__Maste__4222D4EF] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [DF__Temporary__Preci__4316F928] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__NoOfP__440B1D61] DEFAULT (0) FOR [NoOfParts],
	CONSTRAINT [DF__Temporary__Toler__44FF419A] DEFAULT (0) FOR [Tolerance],
	CONSTRAINT [DF__Temporary__Proce__45F365D3] DEFAULT (0) FOR [ProcessVariation],
	CONSTRAINT [DF__Temporary__SubTr__46E78A0C] DEFAULT (0) FOR [SubTrialsCompleted],
	CONSTRAINT [DF__Temporary__Chann__47DBAE45] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__48CFD27E] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaGRRMapping_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[GRRMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[GRRReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__GRRMa__4D94879B] DEFAULT (0) FOR [GRRMapSrNo],
	CONSTRAINT [DF__Temporary__Trial__4F7CD00D] DEFAULT (0) FOR [TrialNo],
	CONSTRAINT [DF__Temporary__Readi__5070F446] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__5165187F] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaGRRReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[GRRMapSrNo],
		[OperatorCode],
		[TrialNo],
		[ReadingSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistCorrectiveAction] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Trend__5629CD9C] DEFAULT (0) FOR [Trend],
	CONSTRAINT [aaaaaHistCorrectiveAction_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[JobSerialno],
		[SampleNo],
		[PartParaCode],
		[PartNo],
		[WorkOrderNo],
		[ProcessCode],
		[MachineNo],
		[Trend]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Chart__59FA5E80] DEFAULT (0) FOR [ChartSerialNumber]
 

ALTER TABLE [dbo].[HistHeader] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__StdDe__5DCAEF64] DEFAULT (0) FOR [StdDeviation],
	CONSTRAINT [DF__TemporaryUps__Pp__5EBF139D] DEFAULT (0) FOR [Pp],
	CONSTRAINT [DF__TemporaryUp__Ppk__5FB337D6] DEFAULT (0) FOR [Ppk]
 

ALTER TABLE [dbo].[HistNonConformities] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sampl__6A30C649] DEFAULT (0) FOR [SampleNo],
	CONSTRAINT [aaaaaHistNonConformities_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[PartNo],
		[WorkOrderDate],
		[PartParaCode],
		[MachineNo],
		[ProcessCode],
		[SampleNo],
		[JobSerialno]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgBiasMapping] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__BiasM__2CF2ADDF] DEFAULT (0) FOR [BiasMapSrNo],
	CONSTRAINT [DF__Temporary__NoOfR__2DE6D218] DEFAULT (0) FOR [NoOfReadings],
	CONSTRAINT [DF__Temporary__Maste__2EDAF651] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [DF__Temporary__Preci__2FCF1A8A] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__BiasV__32AB8735] DEFAULT (0) FOR [BiasValue],
	CONSTRAINT [DF__Temporary__Chann__339FAB6E] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__3493CFA7] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaHistPurgBiasMapping_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[BiasMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgBiasReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__BiasM__395884C4] DEFAULT (0) FOR [BiasMapSrNo],
	CONSTRAINT [DF__Temporary__Readi__3A4CA8FD] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__3B40CD36] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaHistPurgBiasReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[BiasMapSrNo],
		[ReadingSerialNo],
		[SubGroupNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgGRRMapping] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__GRRMa__40058253] DEFAULT (0) FOR [GRRMapSrNo],
	CONSTRAINT [DF__Temporary__Trial__40F9A68C] DEFAULT (0) FOR [TrialsFixed],
	CONSTRAINT [DF__Temporary__NoOfO__41EDCAC5] DEFAULT (0) FOR [NoOfOperators],
	CONSTRAINT [DF__Temporary__Maste__42E1EEFE] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [DF__Temporary__Preci__43D61337] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__NoOfP__44CA3770] DEFAULT (0) FOR [NoOfParts],
	CONSTRAINT [DF__Temporary__Toler__45BE5BA9] DEFAULT (0) FOR [Tolerance],
	CONSTRAINT [DF__Temporary__Proce__46B27FE2] DEFAULT (0) FOR [ProcessVariation],
	CONSTRAINT [DF__Temporary__SubTr__47A6A41B] DEFAULT (0) FOR [SubTrialsCompleted],
	CONSTRAINT [DF__Temporary__Chann__489AC854] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__498EEC8D] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaHistPurgGRRMapping_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[GRRMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgGRRReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__GRRMa__4E53A1AA] DEFAULT (0) FOR [GRRMapSrNo],
	CONSTRAINT [DF__Temporary__Trial__4F47C5E3] DEFAULT (0) FOR [TrialNo],
	CONSTRAINT [DF__Temporary__Readi__503BEA1C] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__51300E55] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaHistPurgGRRReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[GRRMapSrNo],
		[OperatorCode],
		[TrialNo],
		[ReadingSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgLinearityMappingDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Linea__625A9A57] DEFAULT (0) FOR [LinearityMapSrNo],
	CONSTRAINT [DF__Temporary__PartP__634EBE90] DEFAULT (0) FOR [PartParaSeqNo],
	CONSTRAINT [DF__Temporary__Refer__6442E2C9] DEFAULT (0) FOR [ReferenceValue],
	CONSTRAINT [DF__TemporaryU__Bias__65370702] DEFAULT (0) FOR [Bias],
	CONSTRAINT [aaaaaHistPurgLinearityMappingDetail_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LinearityMapSrNo],
		[PartNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgLinearityMappingMaster] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Linea__69FBBC1F] DEFAULT (0) FOR [LinearityMapSrNo],
	CONSTRAINT [DF__Temporary__Preci__6AEFE058] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__NoOfR__6BE40491] DEFAULT (0) FOR [NoOfReadings],
	CONSTRAINT [DF__Temporary__Avera__6DCC4D03] DEFAULT (0) FOR [AverageBias],
	CONSTRAINT [DF__Temporary__Linea__6EC0713C] DEFAULT (0) FOR [Linearity],
	CONSTRAINT [DF__Temporary__Goodn__6FB49575] DEFAULT (0) FOR [GoodnessOfFit],
	CONSTRAINT [DF__Temporary__Slope__70A8B9AE] DEFAULT (0) FOR [SlopeOfRegression],
	CONSTRAINT [DF__Temporary__Chann__719CDDE7] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__72910220] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaHistPurgLinearityMappingMaster_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LinearityMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgLinearityReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Linea__7755B73D] DEFAULT (0) FOR [LinearityMapSrNo],
	CONSTRAINT [DF__Temporary__Readi__7849DB76] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__793DFFAF] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaHistPurgLinearityReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LinearityMapSrNo],
		[PartNo],
		[PartParaCode],
		[ReadingSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgStabilityMapping] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Stabi__7E02B4CC] DEFAULT (0) FOR [StabilityMapSrNo],
	CONSTRAINT [DF__Temporary__Preci__7EF6D905] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__Chann__7FEAFD3E] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__00DF2177] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaHistPurgStabilityMapping_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[StabilityMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgStabilityReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Stabi__05A3D694] DEFAULT (0) FOR [StabilityMapSrNo],
	CONSTRAINT [DF__Temporary__Readi__0697FACD] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__078C1F06] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaHistPurgStabilityReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[StabilityMapSrNo],
		[ReadingSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgingCorrectiveAction] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Trend__55F4C372] DEFAULT (0) FOR [Trend],
	CONSTRAINT [aaaaaHistPurgingCorrectiveAction_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[JobSerialno],
		[SampleNo],
		[PartParaCode],
		[PartNo],
		[WorkOrderNo],
		[ProcessCode],
		[MachineNo],
		[Trend]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistPurgingNonConformities] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sampl__5D95E53A] DEFAULT (0) FOR [SampleNo],
	CONSTRAINT [aaaaaHistPurgingNonConformities_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[PartNo],
		[WorkOrderDate],
		[PartParaCode],
		[MachineNo],
		[ProcessCode],
		[SampleNo],
		[JobSerialno]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryJob] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryJob_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[JobSerialno],
		[StationNo],
		[WorkOrderNo],
		[PartNo],
		[ProcessCode],
		[MachineNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryJobParameter] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Maste__72C60C4A] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [DF__Temporary__Calib__73BA3083] DEFAULT (0) FOR [CalibrationValue],
	CONSTRAINT [aaaaaHistoryJobParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[JobSerialno],
		[WorkOrderNo],
		[StationNo],
		[ServerId],
		[PartNo],
		[ProcessCode],
		[MachineNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryJobReading] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryJobReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[ReadingSerialNo],
		[SampleNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryJobSample] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryJobSample_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[SampleNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryPurgingJob] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryPurgingJob_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[JobSerialno],
		[StationNo],
		[WorkOrderNo],
		[PartNo],
		[ProcessCode],
		[MachineNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryPurgingJobParameter] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Maste__04E4BC85] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [DF__Temporary__Calib__05D8E0BE] DEFAULT (0) FOR [CalibrationValue],
	CONSTRAINT [aaaaaHistoryPurgingJobParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[JobSerialno],
		[WorkOrderNo],
		[StationNo],
		[ServerId],
		[PartNo],
		[ProcessCode],
		[MachineNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryPurgingJobSample] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryPurgingJobSample_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[SampleNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryPurgingJobreading] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryPurgingJobreading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[ReadingSerialNo],
		[SampleNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryPurgingWoQAPParameter] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Calib__123EB7A3] DEFAULT (0) FOR [CalibrationValue],
	CONSTRAINT [aaaaaHistoryPurgingWoQAPParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[PartNo],
		[ProcessCode],
		[PartParaCode],
		[WorkOrderNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryPurgingWoQAPProcess] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryPurgingWoQAPProcess_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[PartNo],
		[WorkOrderNo],
		[ProcessCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryPurgingWorkorder] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryPurgingWorkorder_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[WorkOrderNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryWoQapParameter] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Calib__2739D489] DEFAULT (0) FOR [CalibrationValue],
	CONSTRAINT [aaaaaHistoryWoQapParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[PartNo],
		[ProcessCode],
		[PartParaCode],
		[WorkOrderNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryWoQapProcess] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryWoQapProcess_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[PartNo],
		[WorkOrderNo],
		[ProcessCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[HistoryWorkOrder] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaHistoryWorkOrder_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderDate],
		[WorkOrderNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Instrument] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__AckCh__267ABA7A] DEFAULT (0) FOR [AckChannelNo],
	CONSTRAINT [aaaaaInstrument_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[InstrumentNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[InstrumentInterface] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__NoPar__1209AD79] DEFAULT (0) FOR [NoParametersPerDump],
	CONSTRAINT [DF__Temporary__Paral__12FDD1B2] DEFAULT (0) FOR [ParallelPortDataBits],
	CONSTRAINT [aaaaaInstrumentInterface_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[InterfaceCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[InstrumentType] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaInstrumentType_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[InstrumentType]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Job] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__QapPr__2630A1B7] DEFAULT (0) FOR [QapProcessSeqNo],
	CONSTRAINT [aaaaaJob_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[StationNo],
		[MachineNo],
		[PartNo],
		[ProcessCode],
		[JobSerialno]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[JobParameter] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__QapPr__5B988E2F] DEFAULT (0) FOR [QapProcessSeqNo],
	CONSTRAINT [DF__Temporary__maste__5C8CB268] DEFAULT (0) FOR [mastervalue],
	CONSTRAINT [DF__Temporary__Calib__5D80D6A1] DEFAULT (0) FOR [CalibrationValue],
	CONSTRAINT [aaaaaJobParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[StationNo],
		[PartNo],
		[ProcessCode],
		[JobSerialno],
		[MachineNo],
		[PartParaCode],
		[ServerId]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[JobReading] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaJobReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[PartParaCode],
		[SampleNo],
		[ReadingSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[JobSample] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaJobSample_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[JobSerialno],
		[PartParaCode],
		[SampleNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[LinearityMappingDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Linea__4A4E069C] DEFAULT (0) FOR [LinearityMapSrNo],
	CONSTRAINT [DF__Temporary__PartP__4E1E9780] DEFAULT (0) FOR [PartParaSeqNo],
	CONSTRAINT [DF__Temporary__Refer__4F12BBB9] DEFAULT (0) FOR [ReferenceValue],
	CONSTRAINT [DF__TemporaryU__Bias__5006DFF2] DEFAULT (0) FOR [Bias],
	CONSTRAINT [aaaaaLinearityMappingDetail_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LinearityMapSrNo],
		[PartNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[LinearityMappingMaster] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Linea__3BFFE745] DEFAULT (0) FOR [LinearityMapSrNo],
	CONSTRAINT [DF__Temporary__Preci__3DE82FB7] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__NoOfR__3EDC53F0] DEFAULT (0) FOR [NoOfReadings],
	CONSTRAINT [DF__Temporary__Avera__40C49C62] DEFAULT (0) FOR [AverageBias],
	CONSTRAINT [DF__Temporary__Linea__41B8C09B] DEFAULT (0) FOR [Linearity],
	CONSTRAINT [DF__Temporary__Goodn__42ACE4D4] DEFAULT (0) FOR [GoodnessOfFit],
	CONSTRAINT [DF__Temporary__Slope__43A1090D] DEFAULT (0) FOR [SlopeOfRegression],
	CONSTRAINT [DF__Temporary__Chann__44952D46] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__4589517F] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaLinearityMappingMaster_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LinearityMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[LinearityReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Linea__54CB950F] DEFAULT (0) FOR [LinearityMapSrNo],
	CONSTRAINT [DF__Temporary__Readi__55BFB948] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__56B3DD81] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaLinearityReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LinearityMapSrNo],
		[PartNo],
		[PartParaCode],
		[ReadingSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Location] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaLocation_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LocationCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Machine] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaMachine_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[MachineNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[MachineOperation] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaMachineOperation_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[MachineNo],
		[ProcessCode]
	)  ON [PRIMARY] 
 


ALTER TABLE [dbo].[MachineType] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaMachineType_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[Machinetype]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[MedianDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sampl__7814D14C] DEFAULT (0) FOR [SampleNo],
	CONSTRAINT [DF__Temporary__Chart__7908F585] DEFAULT (0) FOR [ChartSerialNumber],
	CONSTRAINT [DF__Temporary__Media__79FD19BE] DEFAULT (0) FOR [MedianValue],
	CONSTRAINT [DF__Temporary__Sampl__7AF13DF7] DEFAULT (0) FOR [SampleRange]
 

ALTER TABLE [dbo].[MedianHeader] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Chart__7EC1CEDB] DEFAULT (0) FOR [ChartSerialNumber],
	CONSTRAINT [DF__Temporary__Sampl__7FB5F314] DEFAULT (0) FOR [SampleSize],
	CONSTRAINT [DF__Temporary__USLVa__00AA174D] DEFAULT (0) FOR [USLValue],
	CONSTRAINT [DF__Temporary__LSLVa__019E3B86] DEFAULT (0) FOR [LSLValue],
	CONSTRAINT [DF__Temporary__UclMe__02925FBF] DEFAULT (0) FOR [UclMedian],
	CONSTRAINT [DF__Temporary__LCLMe__038683F8] DEFAULT (0) FOR [LCLMedian],
	CONSTRAINT [DF__TemporaryU__Uclr__047AA831] DEFAULT (0) FOR [Uclr],
	CONSTRAINT [DF__TemporaryU__Lclr__056ECC6A] DEFAULT (0) FOR [Lclr],
	CONSTRAINT [DF__Temporary__XMedi__0662F0A3] DEFAULT (0) FOR [XMedianBar],
	CONSTRAINT [DF__TemporaryU__RBar__075714DC] DEFAULT (0) FOR [RBar],
	CONSTRAINT [DF__TemporaryUps__Cp__084B3915] DEFAULT (0) FOR [Cp],
	CONSTRAINT [DF__TemporaryUp__Cpk__093F5D4E] DEFAULT (0) FOR [Cpk],
	CONSTRAINT [DF__TemporaryUps__A2__0A338187] DEFAULT (0) FOR [A2],
	CONSTRAINT [DF__TemporaryUps__D3__0B27A5C0] DEFAULT (0) FOR [D3],
	CONSTRAINT [DF__TemporaryUps__D4__0C1BC9F9] DEFAULT (0) FOR [D4],
	CONSTRAINT [DF__TemporaryUps__Pp__0D0FEE32] DEFAULT (0) FOR [Pp],
	CONSTRAINT [DF__TemporaryUp__Ppk__0E04126B] DEFAULT (0) FOR [Ppk],
	CONSTRAINT [DF__TemporaryUps__Sd__0EF836A4] DEFAULT (0) FOR [Sd]
 

ALTER TABLE [dbo].[ModelClose] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__PartS__1699586C] DEFAULT (0) FOR [PartSerialNo],
	CONSTRAINT [aaaaaModelClose_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[OldPartno],
		[PartSerialNo],
		[Machineno]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ModelShiftTarget] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Targe__414EAC47] DEFAULT (0) FOR [TargetQuantity],
	CONSTRAINT [aaaaaModelShiftTarget_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ShiftCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ModelToolLife] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__7ABC33CD] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__Expec__7BB05806] DEFAULT (0) FOR [ExpectedLife],
	CONSTRAINT [DF__Temporary__Alert__7CA47C3F] DEFAULT (0) FOR [AlertQuantity],
	CONSTRAINT [aaaaaModelToolLife_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNO],
		[MachineNO],
		[ProcessCode],
		[ToolTypeCode],
		[RegroundSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ModelToolLinkRange] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Range__42CCE065] DEFAULT (0) FOR [RangeFrom],
	CONSTRAINT [DF__Temporary__Range__43C1049E] DEFAULT (0) FOR [RangeTo],
	CONSTRAINT [aaaaaModelToolLinkRange_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNO],
		[MachineNo],
		[ProcessCode],
		[ToolTypeCode],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[NonConformities] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sampl__642DD430] DEFAULT (0) FOR [SampleNo],
	CONSTRAINT [aaaaaNonConformities_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[PartNo],
		[WorkOrderDate],
		[PartParaCode],
		[MachineNo],
		[ProcessCode],
		[SampleNo],
		[JobSerialno]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[OperationToolLink] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaOperationToolLink_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ProcessCode],
		[ToolTypeCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[OperationToolLinkParameter] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaOperationToolLinkParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ProcessCode],
		[ToolTypeCode],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[PDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__SubGr__6E565CE8] DEFAULT (0) FOR [SubGroupSize]
 

ALTER TABLE [dbo].[Parameter] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ParaTypeCode],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ParameterType] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaParameterType_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ParaTypeCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ParetoDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Chart__473C8FC7] DEFAULT (0) FOR [ChartSerialNumber],
	CONSTRAINT [DF__Temporary__Noofn__4830B400] DEFAULT (0) FOR [Noofnonconformities],
	CONSTRAINT [DF__Temporary__Total__4924D839] DEFAULT (0) FOR [TotalPercent],
	CONSTRAINT [DF__Temporary__Cumul__4A18FC72] DEFAULT (0) FOR [CumulativePercent]
 

ALTER TABLE [dbo].[ParetoHeader] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Chart__4DE98D56] DEFAULT (0) FOR [ChartSerialNumber]
 

ALTER TABLE [dbo].[Part] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaPart_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[PartMachine] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaPartMachine_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[PartParameter] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaPartParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[PartParameterGRR] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Seria__1FEDB87C] DEFAULT (0) FOR [SerialNo],
	CONSTRAINT [DF__Temporary__Trial__23BE4960] DEFAULT (0) FOR [TrialsFixed],
	CONSTRAINT [DF__Temporary__SubTr__24B26D99] DEFAULT (0) FOR [SubTrialsCompleted],
	CONSTRAINT [DF__Temporary__NoOfO__25A691D2] DEFAULT (0) FOR [NoOfOperators],
	CONSTRAINT [DF__Temporary__Maste__269AB60B] DEFAULT (0) FOR [MasterValue],
	CONSTRAINT [DF__Temporary__Calib__278EDA44] DEFAULT (0) FOR [CalibrationValue],
	CONSTRAINT [DF__Temporary__GainF__2882FE7D] DEFAULT (0) FOR [GainFactor],
	CONSTRAINT [DF__Temporary__Decim__297722B6] DEFAULT (0) FOR [Decimals],
	CONSTRAINT [aaaaaPartParameterGRR_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[SerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[PortReadings] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__PortN__75035A77] DEFAULT (0) FOR [PortNo]
 

ALTER TABLE [dbo].[Process] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaProcess_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ProcessCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Production] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Produ__62AFA012] DEFAULT (0) FOR [ProductionQty],
	CONSTRAINT [aaaaaProduction_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ShiftCode],
		[ShiftDate]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[QapPartParameter] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaQapPartParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[ProcessCode],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[QapProcess] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaQapProcess_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[ProcessCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Readings] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Seria__4A6E022D] DEFAULT (0) FOR [SerialNo],
	CONSTRAINT [DF__Temporary__Trial__4D4A6ED8] DEFAULT (0) FOR [TrialNo],
	CONSTRAINT [DF__Temporary__Readi__4E3E9311] DEFAULT (0) FOR [Reading1],
	CONSTRAINT [DF__Temporary__Readi__4F32B74A] DEFAULT (0) FOR [Reading2],
	CONSTRAINT [DF__Temporary__Readi__5026DB83] DEFAULT (0) FOR [Reading3],
	CONSTRAINT [DF__Temporary__Readi__511AFFBC] DEFAULT (0) FOR [Reading4],
	CONSTRAINT [DF__Temporary__Readi__520F23F5] DEFAULT (0) FOR [Reading5],
	CONSTRAINT [DF__Temporary__Readi__5303482E] DEFAULT (0) FOR [Reading6],
	CONSTRAINT [DF__Temporary__Readi__53F76C67] DEFAULT (0) FOR [Reading7],
	CONSTRAINT [DF__Temporary__Readi__54EB90A0] DEFAULT (0) FOR [Reading8],
	CONSTRAINT [DF__Temporary__Readi__55DFB4D9] DEFAULT (0) FOR [Reading9],
	CONSTRAINT [DF__Temporary__Readi__56D3D912] DEFAULT (0) FOR [Reading10],
	CONSTRAINT [aaaaaReadings_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[SerialNo],
		[PartCode],
		[ParameterCode],
		[TrialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Role] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaRole_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[RoleID]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[RootCause] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaRootCause_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[RootCauseCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[RootCauseDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__SubRo__39AD8A7F] DEFAULT (0) FOR [SubRootCauseCode],
	CONSTRAINT [aaaaaRootCauseDetail_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[RootCauseCode],
		[SubRootCauseCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Shift] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaShift_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ShiftCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[SixSigmaConversion] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sigma__451F3D2B] DEFAULT (0) FOR [SigmaValue],
	CONSTRAINT [DF__Temporary__Defec__46136164] DEFAULT (0) FOR [DefectsPerMillion]
 

ALTER TABLE [dbo].[StabilityMapping] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Stabi__4AD81681] DEFAULT (0) FOR [StabilityMapSrNo],
	CONSTRAINT [DF__Temporary__Preci__4EA8A765] DEFAULT (0) FOR [PrecisionInd],
	CONSTRAINT [DF__Temporary__Chann__4F9CCB9E] DEFAULT (0) FOR [ChannelNo],
	CONSTRAINT [DF__Temporary__PortN__5090EFD7] DEFAULT (0) FOR [PortNo],
	CONSTRAINT [aaaaaStabilityMapping_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[StabilityMapSrNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[StabilityReading] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Stabi__5555A4F4] DEFAULT (0) FOR [StabilityMapSrNo],
	CONSTRAINT [DF__Temporary__Readi__573DED66] DEFAULT (0) FOR [ReadingSerialNo],
	CONSTRAINT [DF__Temporary__Readi__5832119F] DEFAULT (0) FOR [ReadingValue],
	CONSTRAINT [aaaaaStabilityReading_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[StabilityMapSrNo],
		[ReadingSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[StatsConstants] WITH NOCHECK ADD 
	CONSTRAINT [DF__TemporaryUps__E2__5C02A283] DEFAULT (0) FOR [E2],
	CONSTRAINT [DF__Temporary__A2Med__5CF6C6BC] DEFAULT (0) FOR [A2Median]
 

ALTER TABLE [dbo].[Supervisor] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaSupervisor_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[SupervisorCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[TempGRRReport] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Seria__6774552F] DEFAULT (0) FOR [SerialNo],
	CONSTRAINT [DF__Temporary__PartS__68687968] DEFAULT (0) FOR [PartSrlNo],
	CONSTRAINT [DF__Temporary__Trial__695C9DA1] DEFAULT (0) FOR [TrialA1],
	CONSTRAINT [DF__Temporary__Trial__6A50C1DA] DEFAULT (0) FOR [TrialA2],
	CONSTRAINT [DF__Temporary__Trial__6B44E613] DEFAULT (0) FOR [TrialA3],
	CONSTRAINT [DF__Temporary__Avera__6C390A4C] DEFAULT (0) FOR [AverageA],
	CONSTRAINT [DF__Temporary__Range__6D2D2E85] DEFAULT (0) FOR [RangeA],
	CONSTRAINT [DF__Temporary__Trial__6E2152BE] DEFAULT (0) FOR [TrialB1],
	CONSTRAINT [DF__Temporary__Trial__6F1576F7] DEFAULT (0) FOR [TrialB2],
	CONSTRAINT [DF__Temporary__Trial__70099B30] DEFAULT (0) FOR [TrialB3],
	CONSTRAINT [DF__Temporary__Avera__70FDBF69] DEFAULT (0) FOR [AverageB],
	CONSTRAINT [DF__Temporary__Range__71F1E3A2] DEFAULT (0) FOR [RangeB],
	CONSTRAINT [DF__Temporary__Trial__72E607DB] DEFAULT (0) FOR [TrialC1],
	CONSTRAINT [DF__Temporary__Trial__73DA2C14] DEFAULT (0) FOR [TrialC2],
	CONSTRAINT [DF__Temporary__Trial__74CE504D] DEFAULT (0) FOR [TrialC3],
	CONSTRAINT [DF__Temporary__Avera__75C27486] DEFAULT (0) FOR [AverageC],
	CONSTRAINT [DF__Temporary__Range__76B698BF] DEFAULT (0) FOR [RangeC],
	CONSTRAINT [DF__Temporary__XpBar__77AABCF8] DEFAULT (0) FOR [XpBar]
 

ALTER TABLE [dbo].[TempHistorySummary] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sampl__7E57BA87] DEFAULT (0) FOR [SampleSize],
	CONSTRAINT [DF__Temporary__USLVa__7F4BDEC0] DEFAULT (0) FOR [USLValue],
	CONSTRAINT [DF__Temporary__LSLVa__004002F9] DEFAULT (0) FOR [LSLValue],
	CONSTRAINT [DF__Temporary__UCLXB__01342732] DEFAULT (0) FOR [UCLXBar],
	CONSTRAINT [DF__Temporary__LCLXB__02284B6B] DEFAULT (0) FOR [LCLXBar],
	CONSTRAINT [DF__TemporaryU__UCLr__031C6FA4] DEFAULT (0) FOR [UCLr],
	CONSTRAINT [DF__TemporaryU__LCLr__041093DD] DEFAULT (0) FOR [LCLr],
	CONSTRAINT [DF__TemporaryU__LCLs__0504B816] DEFAULT (0) FOR [LCLs],
	CONSTRAINT [DF__TemporaryU__UCLs__05F8DC4F] DEFAULT (0) FOR [UCLs],
	CONSTRAINT [DF__TemporaryUps__Cp__06ED0088] DEFAULT (0) FOR [Cp],
	CONSTRAINT [DF__TemporaryUp__Cpk__07E124C1] DEFAULT (0) FOR [Cpk],
	CONSTRAINT [DF__TemporaryUps__Pp__08D548FA] DEFAULT (0) FOR [Pp],
	CONSTRAINT [DF__TemporaryUp__Ppk__09C96D33] DEFAULT (0) FOR [Ppk],
	CONSTRAINT [DF__Temporary__SubGr__0ABD916C] DEFAULT (0) FOR [SubGroupSize],
	CONSTRAINT [DF__Temporary__numbe__0BB1B5A5] DEFAULT (0) FOR [numberofreadings],
	CONSTRAINT [DF__TemporaryU__mean__0CA5D9DE] DEFAULT (0) FOR [mean],
	CONSTRAINT [DF__Temporary__stdde__0D99FE17] DEFAULT (0) FOR [stddeviation],
	CONSTRAINT [DF__TemporaryU__Rbar__0E8E2250] DEFAULT (0) FOR [Rbar],
	CONSTRAINT [DF__Temporary__xdoub__0F824689] DEFAULT (0) FOR [xdoublebar],
	CONSTRAINT [DF__Temporary__stdde__10766AC2] DEFAULT (0) FOR [stddeviation1],
	CONSTRAINT [DF__Temporary__Recal__116A8EFB] DEFAULT (0) FOR [RecalcLimitAfterSamples],
	CONSTRAINT [DF__Temporary__NoOfT__125EB334] DEFAULT (0) FOR [NoOfTrend]
 

ALTER TABLE [dbo].[TempLinearity] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__NoOfR__162F4418] DEFAULT (0) FOR [NoOfReadings],
	CONSTRAINT [DF__Temporary__Proce__17236851] DEFAULT (0) FOR [ProcessVariation],
	CONSTRAINT [DF__Temporary__Count__18178C8A] DEFAULT (0) FOR [Counters]
 

ALTER TABLE [dbo].[TempProduction] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Produ__1BE81D6E] DEFAULT (0) FOR [ProductionQty],
	CONSTRAINT [DF__Temporary__Colou__1CDC41A7] DEFAULT (0) FOR [Colour],
	CONSTRAINT [DF__Temporary__Targe__1DD065E0] DEFAULT (0) FOR [TargetQuantity]
 

ALTER TABLE [dbo].[TempSummary] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sampl__247D636F] DEFAULT (0) FOR [SampleSize],
	CONSTRAINT [DF__Temporary__LSLVa__257187A8] DEFAULT (0) FOR [LSLValue],
	CONSTRAINT [DF__Temporary__LCLxb__2665ABE1] DEFAULT (0) FOR [LCLxbar],
	CONSTRAINT [DF__TemporaryU__LCLr__2759D01A] DEFAULT (0) FOR [LCLr],
	CONSTRAINT [DF__Temporary__USLVa__284DF453] DEFAULT (0) FOR [USLValue],
	CONSTRAINT [DF__Temporary__UCLxb__2942188C] DEFAULT (0) FOR [UCLxbar],
	CONSTRAINT [DF__TemporaryU__LCLs__2A363CC5] DEFAULT (0) FOR [LCLs],
	CONSTRAINT [DF__TemporaryU__UCLs__2B2A60FE] DEFAULT (0) FOR [UCLs],
	CONSTRAINT [DF__Temporary__JobSe__2C1E8537] DEFAULT (0) FOR [JobSerialNo],
	CONSTRAINT [DF__Temporary__SubGr__2D12A970] DEFAULT (0) FOR [SubGroupSize],
	CONSTRAINT [DF__TemporaryU__UCLr__2E06CDA9] DEFAULT (0) FOR [UCLr],
	CONSTRAINT [DF__TemporaryUps__Pp__2EFAF1E2] DEFAULT (0) FOR [Pp],
	CONSTRAINT [DF__TemporaryUp__Ppk__2FEF161B] DEFAULT (0) FOR [Ppk],
	CONSTRAINT [DF__TemporaryUps__Cp__30E33A54] DEFAULT (0) FOR [Cp],
	CONSTRAINT [DF__TemporaryUp__Cpk__31D75E8D] DEFAULT (0) FOR [Cpk],
	CONSTRAINT [DF__Temporary__Numbe__32CB82C6] DEFAULT (0) FOR [NumberOfReadings],
	CONSTRAINT [DF__TemporaryU__Mean__33BFA6FF] DEFAULT (0) FOR [Mean],
	CONSTRAINT [DF__Temporary__StdDe__34B3CB38] DEFAULT (0) FOR [StdDeviation],
	CONSTRAINT [DF__TemporaryU__RBar__35A7EF71] DEFAULT (0) FOR [RBar],
	CONSTRAINT [DF__Temporary__XDoub__369C13AA] DEFAULT (0) FOR [XDoubleBar],
	CONSTRAINT [DF__Temporary__StdDe__379037E3] DEFAULT (0) FOR [StdDeviation1],
	CONSTRAINT [DF__Temporary__NoOfT__38845C1C] DEFAULT (0) FOR [NoOfTrend]
 

ALTER TABLE [dbo].[TempTLMModelWise] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__3C54ED00] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__PartS__3D491139] DEFAULT (0) FOR [PartSerialNo],
	CONSTRAINT [DF__Temporary__Produ__3E3D3572] DEFAULT (0) FOR [ProducedQty]
 

ALTER TABLE [dbo].[Tool] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__2077C861] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__perce__216BEC9A] DEFAULT (0) FOR [percentbalancelife],
	CONSTRAINT [aaaaaTool_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ToolTypeCode],
		[ToolCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolChange] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Shift__55209ACA] DEFAULT (0) FOR [ShiftProduction],
	CONSTRAINT [DF__Temporary__regro__5614BF03] DEFAULT (0) FOR [regroundserialno],
	CONSTRAINT [DF__Temporary__SubRo__5708E33C] DEFAULT (0) FOR [SubRootCauseCode],
	CONSTRAINT [aaaaaToolChange_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[OldToolCode],
		[ToolChangeDate],
		[regroundserialno]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolChangeHist] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__regro__1B7E091A] DEFAULT (0) FOR [regroundserialno],
	CONSTRAINT [DF__Temporary__PartS__1C722D53] DEFAULT (0) FOR [PartSerialNo],
	CONSTRAINT [DF__Temporary__Shift__1D66518C] DEFAULT (0) FOR [ShiftProduction],
	CONSTRAINT [DF__Temporary__SubRo__1E5A75C5] DEFAULT (0) FOR [SubRootCauseCode],
	CONSTRAINT [aaaaaToolChangeHist1_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[OldToolCode],
		[regroundserialno],
		[ToolChangeDate]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolIssue] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__627A95E8] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__Produ__636EBA21] DEFAULT (0) FOR [ProducedQty],
	CONSTRAINT [DF__Temporary__Param__6462DE5A] DEFAULT (0) FOR [ParameterValue],
	CONSTRAINT [aaaaaToolIssue_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolIssueHist] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__231F2AE2] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__PartS__24134F1B] DEFAULT (0) FOR [PartSerialNo],
	CONSTRAINT [DF__Temporary__Produ__25077354] DEFAULT (0) FOR [ProducedQty],
	CONSTRAINT [aaaaaToolIssueHist1_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolIssueParameterHist] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__29CC2871] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__PartS__2AC04CAA] DEFAULT (0) FOR [PartSerialNo],
	CONSTRAINT [DF__Temporary__Param__2BB470E3] DEFAULT (0) FOR [ParameterValue],
	CONSTRAINT [aaaaaToolIssueParameterHist1_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNo],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolIssueParameters] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__74994623] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__Param__758D6A5C] DEFAULT (0) FOR [ParameterValue],
	CONSTRAINT [aaaaaToolIssueParameters_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolLifeExceptions] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__7A521F79] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__Expec__7B4643B2] DEFAULT (0) FOR [Expectedlife],
	CONSTRAINT [DF__Temporary__Excee__7C3A67EB] DEFAULT (0) FOR [ExceededQty],
	CONSTRAINT [DF__Temporary__Curre__7D2E8C24] DEFAULT (0) FOR [Currentlife]
 

ALTER TABLE [dbo].[ToolParaChange] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__01F34141] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__ParaS__02E7657A] DEFAULT (0) FOR [ParaSerialNo],
	CONSTRAINT [DF__Temporary__Shift__03DB89B3] DEFAULT (0) FOR [ShiftQuantity],
	CONSTRAINT [DF__Temporary__Total__04CFADEC] DEFAULT (0) FOR [TotalQuantity],
	CONSTRAINT [aaaaaToolParaChange_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[ParaSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolParaChangeDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__09946309] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__ParaS__0A888742] DEFAULT (0) FOR [ParaSerialNo],
	CONSTRAINT [DF__Temporary__Param__0B7CAB7B] DEFAULT (0) FOR [ParameterValue],
	CONSTRAINT [aaaaaToolParaChangeDetail_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[ParaSerialNo],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolParaChangeDtlHist] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__3A02903A] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__PartS__3AF6B473] DEFAULT (0) FOR [PartSerialNO],
	CONSTRAINT [DF__Temporary__ParaS__3BEAD8AC] DEFAULT (0) FOR [ParaSerialNo],
	CONSTRAINT [DF__Temporary__Param__3CDEFCE5] DEFAULT (0) FOR [ParameterValue],
	CONSTRAINT [aaaaaToolParaChangeDtlHist1_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNO],
		[ParaSerialNo],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolParaChangeHist] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__316D4A39] DEFAULT (0) FOR [RegroundSerialNo],
	CONSTRAINT [DF__Temporary__PartS__32616E72] DEFAULT (0) FOR [PartSerialNo],
	CONSTRAINT [DF__Temporary__ParaS__335592AB] DEFAULT (0) FOR [ParaSerialNo],
	CONSTRAINT [DF__Temporary__Shift__3449B6E4] DEFAULT (0) FOR [ShiftQuantity],
	CONSTRAINT [DF__Temporary__Total__353DDB1D] DEFAULT (0) FOR [TotalQuantity],
	CONSTRAINT [aaaaaToolParaChangeHist1_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNo],
		[ParaSerialNo]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolType] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Regro__24E777C3] DEFAULT (0) FOR [RegroundNo],
	CONSTRAINT [aaaaaToolType_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[TooltypeCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[ToolTypeParameter] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaToolTypeParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[ToolTypeCode],
		[ParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[TrendForXBar] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__UpMea__2BE97B0D] DEFAULT (0) FOR [UpMeanRuns],
	CONSTRAINT [DF__Temporary__DownM__2CDD9F46] DEFAULT (0) FOR [DownMeanRuns],
	CONSTRAINT [DF__Temporary__UpRan__2DD1C37F] DEFAULT (0) FOR [UpRangeRuns],
	CONSTRAINT [DF__Temporary__DownR__2EC5E7B8] DEFAULT (0) FOR [DownRangeRuns],
	CONSTRAINT [DF__Temporary__Great__2FBA0BF1] DEFAULT (0) FOR [GreaterThanMeanRuns],
	CONSTRAINT [DF__Temporary__LessT__30AE302A] DEFAULT (0) FOR [LessThanMeansRuns],
	CONSTRAINT [DF__Temporary__Great__31A25463] DEFAULT (0) FOR [GreaterThanRangeRuns],
	CONSTRAINT [DF__Temporary__LessT__3296789C] DEFAULT (0) FOR [LessThanRangeRuns],
	CONSTRAINT [aaaaaTrendForXBar_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[StationNo],
		[WorkOrderDate],
		[PartNo],
		[ProcessCode],
		[JobSerialno],
		[MachineNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Trends] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Trend__36670980] DEFAULT (0) FOR [Trend]
 

ALTER TABLE [dbo].[UDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__SubGr__3A379A64] DEFAULT (0) FOR [SubGroupSize]
 

ALTER TABLE [dbo].[UnitOfMeasurement] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaUnitOfMeasurement_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[UomCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Users] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaUsers_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[UserCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[WoQapParameter] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__QapPr__08162EEB] DEFAULT (0) FOR [QapProcessSeqNo],
	CONSTRAINT [DF__Temporary__Calib__09FE775D] DEFAULT (0) FOR [CalibrationValue],
	CONSTRAINT [DF__Temporary__gainf__0AF29B96] DEFAULT (0) FOR [gainfactor],
	CONSTRAINT [aaaaaWoQapParameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[PartNo],
		[ProcessCode],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[WoQapProcess] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__QapPr__119F9925] DEFAULT (0) FOR [QapProcessSeqNo],
	CONSTRAINT [aaaaaWoQapProcess_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[PartNo],
		[ProcessCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[WorkOrder] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaWorkOrder_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[WorkOrderNo],
		[WorkOrderDate]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[XBarRDetail] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Sampl__6DB73E6A] DEFAULT (0) FOR [SampleRange]
 

ALTER TABLE [dbo].[XBarRHeader] WITH NOCHECK ADD 
	CONSTRAINT [DF__TemporaryUps__A2__7187CF4E] DEFAULT (0) FOR [A2],
	CONSTRAINT [DF__TemporaryUps__D3__727BF387] DEFAULT (0) FOR [D3],
	CONSTRAINT [DF__TemporaryUps__D4__737017C0] DEFAULT (0) FOR [D4],
	CONSTRAINT [DF__TemporaryUps__Pp__74643BF9] DEFAULT (0) FOR [Pp],
	CONSTRAINT [DF__TemporaryUp__Ppk__75586032] DEFAULT (0) FOR [Ppk],
	CONSTRAINT [DF__TemporaryUps__SD__764C846B] DEFAULT (0) FOR [SD]
 

ALTER TABLE [dbo].[XBarSHeader] WITH NOCHECK ADD 
	CONSTRAINT [DF__TemporaryUps__Pp__058EC7FB] DEFAULT (0) FOR [Pp],
	CONSTRAINT [DF__TemporaryUp__Ppk__0682EC34] DEFAULT (0) FOR [Ppk],
	CONSTRAINT [DF__TemporaryUps__SD__0777106D] DEFAULT (0) FOR [SD]
 

ALTER TABLE [dbo].[XBarSettings] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Trend__7CF981FA] DEFAULT (0) FOR [TrendsRuns],
	CONSTRAINT [DF__TemporaryU__Runs__7DEDA633] DEFAULT (0) FOR [Runs],
	CONSTRAINT [DF__Temporary__Trend__7EE1CA6C] DEFAULT (0) FOR [TrendsRunsLevel2],
	CONSTRAINT [DF__Temporary__RunsL__7FD5EEA5] DEFAULT (0) FOR [RunsLevel2],
	CONSTRAINT [DF__Temporary__CPKLi__00CA12DE] DEFAULT (0) FOR [CPKLimit],
	CONSTRAINT [DF__Temporary__PPKLi__01BE3717] DEFAULT (0) FOR [PPKLimit]
 

ALTER TABLE [dbo].[XHeader] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__LCLXB__0E240DFC] DEFAULT (0) FOR [LCLXBar],
	CONSTRAINT [DF__Temporary__UCLXB__0F183235] DEFAULT (0) FOR [UCLXBar]
 

ALTER TABLE [dbo].[fixture] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__Calib__2E1BDC42] DEFAULT (0) FOR [CalibrationInterval],
	CONSTRAINT [aaaaafixture1_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[fixturecode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[fixtureparameter] WITH NOCHECK ADD 
	CONSTRAINT [aaaaafixtureparameter_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[fixturecode],
		[partparacode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[fixtureprobes] WITH NOCHECK ADD 
	CONSTRAINT [DF__Temporary__probe__37A5467C] DEFAULT (0) FOR [probeno],
	CONSTRAINT [aaaaafixtureprobes_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[fixturecode],
		[probeno]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Plants] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaPlant_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PlantCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Divisions] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaDivision_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[DivCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Units] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaUnit_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[UnitCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[Cells] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaCell_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[LocationCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[MachineEvent] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaMachineEvent_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[SrNo],
		[MachineNo],
		[EventDate],
		[EventTime],
		[EventCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[MachineEventDetail] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaMachineEventDetail_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[SrNo],
		[JobSerialNo],
		[PartParaCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[PRESIDENT] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaPresident_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[PresidentCode]
	)  ON [PRIMARY] 
 

ALTER TABLE [dbo].[GMANAGER] WITH NOCHECK ADD 
	CONSTRAINT [aaaaaGManager_PK] PRIMARY KEY  NONCLUSTERED 
	(
		[GManagerCode]
	)  ON [PRIMARY] 
 


 CREATE  INDEX [BatchDate] ON [dbo].[Batch]([BatchDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderBatch] ON [dbo].[Batch]([WorkOrderNo], [WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [InstrumentBiasMapping] ON [dbo].[BiasMapping]([InstrumentNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartBiasMapping] ON [dbo].[BiasMapping]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[BiasMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterBiasMapping] ON [dbo].[BiasMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [BiasMappingBiasReading] ON [dbo].[BiasReading]([BiasMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[CDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingNo] ON [dbo].[CDetail]([ReadingNo]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[CDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[CHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[CHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[CHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[CHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[CHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[CHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[CHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[ChartIndex]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [ChartType] ON [dbo].[ChartIndex]([ChartType]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[ChartIndex]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseCorrectiveAction] ON [dbo].[CorrectiveAction]([RootCause]) ON [PRIMARY]
 

 CREATE  INDEX [CustomerCustomerPart] ON [dbo].[CustomerPart]([CustomerCode]) ON [PRIMARY]
 

 CREATE  INDEX [CustomerPartNo] ON [dbo].[CustomerPart]([CustomerPartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartCustomerPart] ON [dbo].[CustomerPart]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [fixtureFixtureMapping] ON [dbo].[FixtureMapping]([FixtureCode]) ON [PRIMARY]
 

 CREATE  INDEX [FixtyreCode] ON [dbo].[FixtureMapping]([FixtureCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[FixtureMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[FixtureMapping]([ProcessCode]) ON [PRIMARY]
 

 CREATE  UNIQUE  INDEX [GRRMapSrNo] ON [dbo].[GRRMapping]([GRRMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [InstrumentGRRMapping] ON [dbo].[GRRMapping]([InstrumentNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartGRRMapping] ON [dbo].[GRRMapping]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterGRRMapping] ON [dbo].[GRRMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [GRRMappingGRRReading] ON [dbo].[GRRReading]([GRRMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [OperatorCode] ON [dbo].[GRRReading]([OperatorCode]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[HistDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[HistDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[HistHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[HistHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[HistHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [DisposalActionCode] ON [dbo].[HistJobDisposal]([DisposalActionCode]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistJobDisposal]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[HistJobDisposal]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[HistJobDisposal]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistJobDisposal]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[HistJobDisposal]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistPurgBiasMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  UNIQUE  INDEX [GRRMapSrNo] ON [dbo].[HistPurgGRRMapping]([GRRMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [OperatorCode] ON [dbo].[HistPurgGRRReading]([OperatorCode]) ON [PRIMARY]
 

 CREATE  INDEX [LinearityMappingDetailLinearityMapSrNo] ON [dbo].[HistPurgLinearityMappingDetail]([LinearityMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistPurgStabilityMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [StabilityReadingStabilityMapSrNo] ON [dbo].[HistPurgStabilityReading]([StabilityMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [DisposalActionCode] ON [dbo].[HistPurgingCorrectiveAction]([DisposalActionCode]) ON [PRIMARY]
 

 CREATE  INDEX [DisposalActionCode] ON [dbo].[HistPurgingJobDisposal]([DisposalActionCode]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistPurgingJobDisposal]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[HistPurgingJobDisposal]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[HistPurgingJobDisposal]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistPurgingJobDisposal]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ReworkProcessCode] ON [dbo].[HistPurgingJobDisposal]([ReworkProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[HistPurgingJobDisposal]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [ServerId] ON [dbo].[HistPurgingNonConformities]([ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryJob]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[HistoryJob]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryJob]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryJob]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[HistoryJob]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryJob]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryJob]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [FixtureCode] ON [dbo].[HistoryJobParameter]([FixtureCode]) ON [PRIMARY]
 

 CREATE  INDEX [HistoryJobHistoryJobParameter] ON [dbo].[HistoryJobParameter]([WorkOrderDate], [JobSerialno], [StationNo], [WorkOrderNo], [PartNo], [ProcessCode], [MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryJobParameter]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[HistoryJobParameter]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryJobParameter]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryJobParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryJobParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ServerId] ON [dbo].[HistoryJobParameter]([ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[HistoryJobParameter]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryJobParameter]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryJobParameter]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryJobReading]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[HistoryJobReading]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[HistoryJobReading]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryJobReading]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingSerialNo] ON [dbo].[HistoryJobReading]([ReadingSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[HistoryJobReading]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryJobSample]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[HistoryJobSample]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[HistoryJobSample]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryJobSample]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[HistoryJobSample]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryPurgingJob]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[HistoryPurgingJob]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryPurgingJob]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryPurgingJob]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [QapID] ON [dbo].[HistoryPurgingJob]([QapID]) ON [PRIMARY]
 

 CREATE  INDEX [ServerId] ON [dbo].[HistoryPurgingJob]([ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[HistoryPurgingJob]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryPurgingJob]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryPurgingJob]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [FinalInspectionID] ON [dbo].[HistoryPurgingJobParameter]([FinalInspectionID]) ON [PRIMARY]
 

 CREATE  INDEX [FixtureCode] ON [dbo].[HistoryPurgingJobParameter]([FixtureCode]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryPurgingJobParameter]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [LocationCode] ON [dbo].[HistoryPurgingJobParameter]([LocationCode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[HistoryPurgingJobParameter]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryPurgingJobParameter]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryPurgingJobParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryPurgingJobParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ServerId] ON [dbo].[HistoryPurgingJobParameter]([ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[HistoryPurgingJobParameter]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UomCode] ON [dbo].[HistoryPurgingJobParameter]([UomCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryPurgingJobParameter]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryPurgingJobParameter]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryPurgingJobSample]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[HistoryPurgingJobSample]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[HistoryPurgingJobSample]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryPurgingJobSample]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ReworkProcessCode] ON [dbo].[HistoryPurgingJobSample]([ReworkProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[HistoryPurgingJobSample]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftCode] ON [dbo].[HistoryPurgingJobSample]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[HistoryPurgingJobreading]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[HistoryPurgingJobreading]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[HistoryPurgingJobreading]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryPurgingJobreading]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingSerialNo] ON [dbo].[HistoryPurgingJobreading]([ReadingSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[HistoryPurgingJobreading]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftCode] ON [dbo].[HistoryPurgingJobreading]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [FinalInspectionID] ON [dbo].[HistoryPurgingWoQAPParameter]([FinalInspectionID]) ON [PRIMARY]
 

 CREATE  INDEX [InterFaceCode] ON [dbo].[HistoryPurgingWoQAPParameter]([InterFaceCode]) ON [PRIMARY]
 

 CREATE  INDEX [NumberOfSubGroups] ON [dbo].[HistoryPurgingWoQAPParameter]([NumberOfSubGroups]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryPurgingWoQAPParameter]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryPurgingWoQAPParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryPurgingWoQAPParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [UomCode] ON [dbo].[HistoryPurgingWoQAPParameter]([UomCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryPurgingWoQAPParameter]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryPurgingWoQAPParameter]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryPurgingWoQAPProcess]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryPurgingWoQAPProcess]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryPurgingWoQAPProcess]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryPurgingWoQAPProcess]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderCloseDate] ON [dbo].[HistoryPurgingWorkorder]([WorkOrderCloseDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryPurgingWorkorder]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryPurgingWorkorder]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [HistoryWorkOrderHistoryWoQapParameter] ON [dbo].[HistoryWoQapParameter]([WorkOrderDate], [WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryWoQapParameter]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[HistoryWoQapParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryWoQapParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryWoQapParameter]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryWoQapParameter]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [HistoryWorkOrderHistoryWoQapProcess] ON [dbo].[HistoryWoQapProcess]([WorkOrderDate], [WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[HistoryWoQapProcess]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[HistoryWoQapProcess]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryWoQapProcess]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryWoQapProcess]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderCloseDate] ON [dbo].[HistoryWorkOrder]([WorkOrderCloseDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[HistoryWorkOrder]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[HistoryWorkOrder]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [CalibrationDate] ON [dbo].[Instrument]([CalibrationDate]) ON [PRIMARY]
 

 CREATE  INDEX [InstrumentType] ON [dbo].[Instrument]([InstrumentType]) ON [PRIMARY]
 

 CREATE  INDEX [InstrumentTypeInstrument] ON [dbo].[Instrument]([InstrumentType]) ON [PRIMARY]
 

 CREATE  INDEX [InterfaceCode] ON [dbo].[Instrument]([InterfaceCode]) ON [PRIMARY]
 

 CREATE  INDEX [LocationInstrument] ON [dbo].[Instrument]([LocationCode]) ON [PRIMARY]
 

 CREATE  INDEX [InterfaceCode] ON [dbo].[InstrumentInterface]([InterfaceCode]) ON [PRIMARY]
 

 CREATE  INDEX [Interface Code] ON [dbo].[InstrumentType]([InterfaceCode]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[Job]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[Job]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[Job]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[Job]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[Job]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ServerId] ON [dbo].[Job]([ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[Job]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [WoQapProcessJob] ON [dbo].[Job]([WorkOrderNo], [WorkOrderDate], [PartNo], [ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[Job]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[Job]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [DisposalActionCode] ON [dbo].[JobDisposal]([DisposalActionCode]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[JobDisposal]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[JobDisposal]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[JobDisposal]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[JobDisposal]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[JobDisposal]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [FinalInspectionID] ON [dbo].[JobParameter]([FinalInspectionID]) ON [PRIMARY]
 

 CREATE  INDEX [Fixturecode] ON [dbo].[JobParameter]([Fixturecode]) ON [PRIMARY]
 

 CREATE  INDEX [JobJobParameter] ON [dbo].[JobParameter]([WorkOrderNo], [WorkOrderDate], [StationNo], [MachineNo], [PartNo], [ProcessCode], [JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[JobParameter]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[JobParameter]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [LocationCode] ON [dbo].[JobParameter]([LocationCode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[JobParameter]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[JobParameter]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[JobParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[JobParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ServerId1] ON [dbo].[JobParameter]([ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[JobParameter]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UomCode] ON [dbo].[JobParameter]([UomCode]) ON [PRIMARY]
 

 CREATE  INDEX [WoQapParameterJobParameter] ON [dbo].[JobParameter]([WorkOrderNo], [WorkOrderDate], [PartNo], [ProcessCode], [PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[JobParameter]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[JobParameter]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[JobReading]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[JobReading]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingSerialNo] ON [dbo].[JobReading]([ReadingSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[JobReading]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [HomogenizedDate] ON [dbo].[JobSample]([HomogenizedDate]) ON [PRIMARY]
 

 CREATE  INDEX [HomogenizedTime] ON [dbo].[JobSample]([HomogenizedTime]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[JobSample]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartDate] ON [dbo].[JobSample]([JobStartDate]) ON [PRIMARY]
 

 CREATE  INDEX [JobStartTime] ON [dbo].[JobSample]([JobStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[JobSample]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[JobSample]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [LinearityMappingDetailLinearityMapSrNo] ON [dbo].[LinearityMappingDetail]([LinearityMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [LinearityMappingMasterLinearityMappingDetail] ON [dbo].[LinearityMappingDetail]([LinearityMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartLinearityMappingDetail] ON [dbo].[LinearityMappingDetail]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterLinearityMappingDetail] ON [dbo].[LinearityMappingDetail]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [InstrumentLinearityMappingMaster] ON [dbo].[LinearityMappingMaster]([InstrumentNo]) ON [PRIMARY]
 

 CREATE  INDEX [LinearityMappingDetailLinearityReading] ON [dbo].[LinearityReading]([LinearityMapSrNo], [PartNo], [PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [LocationCode] ON [dbo].[Machine]([LocationCode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineTypeMachine] ON [dbo].[Machine]([Machinetype]) ON [PRIMARY]
 

 CREATE  INDEX [MachineMachineOperation] ON [dbo].[MachineOperation]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[MachineOperation]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[MachineOperation]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessMachineOperation] ON [dbo].[MachineOperation]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [Fixturecode] ON [dbo].[MasteringDetail]([Fixturecode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[MasteringDetail]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[MasteringDetail]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ServerId] ON [dbo].[MasteringDetail]([ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[MasteringDetail]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [Partparacode] ON [dbo].[MedianHeader]([Partparacode]) ON [PRIMARY]
 

 CREATE  INDEX [Processcode] ON [dbo].[MedianHeader]([Processcode]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[MedianHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [OldPartno] ON [dbo].[ModelClose]([OldPartno]) ON [PRIMARY]
 

 CREATE  INDEX [Shiftcode] ON [dbo].[ModelClose]([Shiftcode]) ON [PRIMARY]
 

 CREATE  INDEX [USercode] ON [dbo].[ModelClose]([USercode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineModelShiftTarget] ON [dbo].[ModelShiftTarget]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartModelShiftTarget] ON [dbo].[ModelShiftTarget]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ModelShiftTarget]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftCode] ON [dbo].[ModelShiftTarget]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftModelShiftTarget] ON [dbo].[ModelShiftTarget]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineOperationModelToolLife] ON [dbo].[ModelToolLife]([MachineNO], [ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartModelToolLife] ON [dbo].[ModelToolLife]([PartNO]) ON [PRIMARY]
 

 CREATE  INDEX [PartNO] ON [dbo].[ModelToolLife]([PartNO]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ModelToolLife]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeCode] ON [dbo].[ModelToolLife]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineOperationModelToolLinkRange] ON [dbo].[ModelToolLinkRange]([MachineNo], [ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [OperationToolLinkParameterModelToolLinkRange] ON [dbo].[ModelToolLinkRange]([ProcessCode], [ToolTypeCode], [ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParaCode] ON [dbo].[ModelToolLinkRange]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartModelToolLinkRange] ON [dbo].[ModelToolLinkRange]([PartNO]) ON [PRIMARY]
 

 CREATE  INDEX [PartNO] ON [dbo].[ModelToolLinkRange]([PartNO]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ModelToolLinkRange]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeCode] ON [dbo].[ModelToolLinkRange]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[NPDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingNo] ON [dbo].[NPDetail]([ReadingNo]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[NPDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[NPHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[NPHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[NPHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[NPHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[NPHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[NPHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[NPHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [JobParameterNonConformities] ON [dbo].[NonConformities]([WorkOrderNo], [WorkOrderDate], [StationNo], [PartNo], [ProcessCode], [JobSerialno], [MachineNo], [PartParaCode], [ServerId]) ON [PRIMARY]
 

 CREATE  INDEX [PartOperationToolLink] ON [dbo].[OperationToolLink]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[OperationToolLink]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeCode] ON [dbo].[OperationToolLink]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [OperationToolLinkOperationToolLinkParameter] ON [dbo].[OperationToolLinkParameter]([ProcessCode], [ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParaCode] ON [dbo].[OperationToolLinkParameter]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[OperationToolLinkParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeCode] ON [dbo].[OperationToolLinkParameter]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeParameterOperationToolLinkParameter] ON [dbo].[OperationToolLinkParameter]([ToolTypeCode], [ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [UnitOfMeasurementOperationToolLinkParameter] ON [dbo].[OperationToolLinkParameter]([UomCode]) ON [PRIMARY]
 

 CREATE  INDEX [UomCode] ON [dbo].[OperationToolLinkParameter]([UomCode]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[PCTDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingNo] ON [dbo].[PCTDetail]([ReadingNo]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[PCTDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[PCTHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[PCTHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[PCTHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[PCTHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[PCTHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[PCTHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[PCTHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[PDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingNo] ON [dbo].[PDetail]([ReadingNo]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[PDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[PHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[PHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[PHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[PHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[PHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[PHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[PHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  UNIQUE  INDEX [ParaId] ON [dbo].[Parameter]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParameterTypeParameter] ON [dbo].[Parameter]([ParaTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParaTypeId] ON [dbo].[Parameter]([ParaTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParaTypeCode] ON [dbo].[ParameterType]([ParaTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[ParetoDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseCode] ON [dbo].[ParetoDetail]([RootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[ParetoDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[ParetoHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [FromDate] ON [dbo].[ParetoHeader]([FromDate]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ParetoHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[ParetoHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ParetoHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[ParetoHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ToDate] ON [dbo].[ParetoHeader]([ToDate]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[ParetoHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[ParetoHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [MachinePartMachine] ON [dbo].[PartMachine]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartPartMachine] ON [dbo].[PartMachine]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [XIF59PartMachine] ON [dbo].[PartMachine]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [XIF60PartMachine] ON [dbo].[PartMachine]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [OperatorCOde] ON [dbo].[PartParameterGRR]([OperatorCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParameterCode] ON [dbo].[PartParameterGRR]([ParameterCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartCode] ON [dbo].[PartParameterGRR]([PartCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterPartParameterGRR] ON [dbo].[PartParameterGRR]([ParameterCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartPartParameterGRR] ON [dbo].[PartParameterGRR]([PartCode]) ON [PRIMARY]
 

 CREATE  INDEX [UsersPartParameterGRR] ON [dbo].[PartParameterGRR]([OperatorCode]) ON [PRIMARY]
 

 CREATE  INDEX [ModelCode] ON [dbo].[Production]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftCode] ON [dbo].[Production]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftProduction] ON [dbo].[Production]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [supervisorcode] ON [dbo].[Production]([supervisorcode]) ON [PRIMARY]
 

 CREATE  INDEX [SupervisorProduction] ON [dbo].[Production]([supervisorcode]) ON [PRIMARY]
 

 CREATE  INDEX [Toolid] ON [dbo].[Production]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[Production]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[QapPartParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterQapPartParameter] ON [dbo].[QapPartParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[QapPartParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [QapPartParameterInterFaceCode] ON [dbo].[QapPartParameter]([InterfaceCode]) ON [PRIMARY]
 

 CREATE  INDEX [QapPartParameterPartNo] ON [dbo].[QapPartParameter]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [UnitOfMeasurementQapPartParameter] ON [dbo].[QapPartParameter]([UomCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[QapProcess]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartQapProcess] ON [dbo].[QapProcess]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[QapProcess]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessQapProcess] ON [dbo].[QapProcess]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [QapProcessSeqNo] ON [dbo].[QapProcess]([QapProcessSeqNo]) ON [PRIMARY]
 

 CREATE  INDEX [OperatorCode] ON [dbo].[Readings]([OperatorCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParameterCode] ON [dbo].[Readings]([ParameterCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartCode] ON [dbo].[Readings]([PartCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterGRRReadings] ON [dbo].[Readings]([SerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [SerialNo] ON [dbo].[Readings]([SerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [UsersReadings] ON [dbo].[Readings]([OperatorCode]) ON [PRIMARY]
 

 CREATE  INDEX [UserCOde] ON [dbo].[RecordLock]([UserCOde]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseRootCause] ON [dbo].[RootCause]([RootCause]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseCode] ON [dbo].[RootCauseDetail]([RootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseRootCauseDetail] ON [dbo].[RootCauseDetail]([RootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftEndTime] ON [dbo].[Shift]([ShiftEndTime]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftStartTime] ON [dbo].[Shift]([ShiftStartTime]) ON [PRIMARY]
 

 CREATE  INDEX [InstrumentStabilityMapping] ON [dbo].[StabilityMapping]([InstrumentNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[StabilityMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterStabilityMapping] ON [dbo].[StabilityMapping]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartStabilityMapping] ON [dbo].[StabilityMapping]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [StabilityMappingStabilityReading] ON [dbo].[StabilityReading]([StabilityMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [StabilityReadingStabilityMapSrNo] ON [dbo].[StabilityReading]([StabilityMapSrNo]) ON [PRIMARY]
 

 CREATE  INDEX [SupervisorCode] ON [dbo].[Supervisor]([SupervisorCode]) ON [PRIMARY]
 

 CREATE  UNIQUE  INDEX [UsersSupervisor] ON [dbo].[Supervisor]([SupervisorCode]) ON [PRIMARY]
 

 CREATE  INDEX [SerialNo] ON [dbo].[TempGRRReport]([SerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[TempProduction]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[TempProduction]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftCode] ON [dbo].[TempProduction]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [NumberOfReadings] ON [dbo].[TempSummary]([NumberOfReadings]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[TempSummary]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[TempSummary]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[TempTLMModelWise]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[TempTLMModelWise]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartSerialNo] ON [dbo].[TempTLMModelWise]([PartSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[TempTLMModelWise]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [RegroundSerialNo] ON [dbo].[TempTLMModelWise]([RegroundSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[TempTLMModelWise]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [Usercode] ON [dbo].[TempTLMModelWise]([Usercode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[TempTLMOperatwise]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[TempTLMOperatwise]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[TempTLMToolIssue]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[TempTLMToolIssue]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeCode] ON [dbo].[TempTLMToolIssue]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[Tool]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [Toolid] ON [dbo].[Tool]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeTool] ON [dbo].[Tool]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [NewToolCode] ON [dbo].[ToolChange]([NewToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [OldToolCode] ON [dbo].[ToolChange]([OldToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolChange]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolChange]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseCode] ON [dbo].[ToolChange]([RootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [Shiftcode] ON [dbo].[ToolChange]([Shiftcode]) ON [PRIMARY]
 

 CREATE  INDEX [SubRootCauseCode] ON [dbo].[ToolChange]([SubRootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [ModelCloseToolChangeHist] ON [dbo].[ToolChangeHist]([PartNo], [PartSerialNo], [MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [NewToolCode] ON [dbo].[ToolChangeHist]([NewToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [OldToolCode] ON [dbo].[ToolChangeHist]([OldToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolChangeHist]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolChangeHist]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseCode] ON [dbo].[ToolChangeHist]([RootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [Shiftcode] ON [dbo].[ToolChangeHist]([Shiftcode]) ON [PRIMARY]
 

 CREATE  INDEX [SubRootCauseCode] ON [dbo].[ToolChangeHist]([SubRootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[ToolIssue]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolIssue]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolIssue]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [RegroundSerialNo] ON [dbo].[ToolIssue]([RegroundSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolIssue]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [Usercode] ON [dbo].[ToolIssue]([Usercode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[ToolIssueHist]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [ModelCloseToolIssueHist] ON [dbo].[ToolIssueHist]([PartNo], [PartSerialNo], [MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolIssueHist]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartSerialNo] ON [dbo].[ToolIssueHist]([PartSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolIssueHist]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [RegroundSerialNo] ON [dbo].[ToolIssueHist]([RegroundSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolIssueHist]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [Usercode] ON [dbo].[ToolIssueHist]([Usercode]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[ToolIssueParameterHist]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [ParaCode] ON [dbo].[ToolIssueParameterHist]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolIssueParameterHist]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartSerialNo] ON [dbo].[ToolIssueParameterHist]([PartSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolIssueParameterHist]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [RegroundSerialNo] ON [dbo].[ToolIssueParameterHist]([RegroundSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolIssueParameterHist]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolIssueHistToolIssueParameterHist] ON [dbo].[ToolIssueParameterHist]([PartNo], [MachineNo], [ProcessCode], [ToolCode], [RegroundSerialNo], [PartSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[ToolIssueParameters]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [ParaCode] ON [dbo].[ToolIssueParameters]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolIssueParameters]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolIssueParameters]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [RegroundSerialNo] ON [dbo].[ToolIssueParameters]([RegroundSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolIssueParameters]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolIssueToolIssueParameters] ON [dbo].[ToolIssueParameters]([PartNo], [MachineNo], [ProcessCode], [ToolCode], [RegroundSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ShiftCode] ON [dbo].[ToolLifeExceptions]([ShiftCode]) ON [PRIMARY]
 

 CREATE  INDEX [SupervisorCode] ON [dbo].[ToolLifeExceptions]([SupervisorCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolLifeExceptions]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [USerCode] ON [dbo].[ToolLifeExceptions]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolParaChange]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolParaChange]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolParaChange]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [Usercode] ON [dbo].[ToolParaChange]([Usercode]) ON [PRIMARY]
 

 CREATE  INDEX [ParaCode] ON [dbo].[ToolParaChangeDetail]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolParaChangeDetail]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolParaChangeDetail]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolParaChangeDetail]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolParaChangeToolParaChangeDetail] ON [dbo].[ToolParaChangeDetail]([PartNo], [MachineNo], [ProcessCode], [ToolCode], [RegroundSerialNo], [ParaSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ParaCode] ON [dbo].[ToolParaChangeDtlHist]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolParaChangeDtlHist]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolParaChangeDtlHist]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolParaChangeDtlHist]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolParaChangeHistToolParaChangeDtlHist] ON [dbo].[ToolParaChangeDtlHist]([PartNo], [MachineNo], [ProcessCode], [ToolCode], [RegroundSerialNo], [PartSerialNO], [ParaSerialNo]) ON [PRIMARY]
 

 CREATE  INDEX [ModelCloseToolParaChangeHist] ON [dbo].[ToolParaChangeHist]([PartNo], [PartSerialNo], [MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[ToolParaChangeHist]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[ToolParaChangeHist]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolCode] ON [dbo].[ToolParaChangeHist]([ToolCode]) ON [PRIMARY]
 

 CREATE  INDEX [Usercode] ON [dbo].[ToolParaChangeHist]([Usercode]) ON [PRIMARY]
 

 CREATE  INDEX [TooltypeCode] ON [dbo].[ToolType]([TooltypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParaCode] ON [dbo].[ToolTypeParameter]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ParameterToolTypeParameter] ON [dbo].[ToolTypeParameter]([ParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeCode] ON [dbo].[ToolTypeParameter]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [ToolTypeToolTypeParameter] ON [dbo].[ToolTypeParameter]([ToolTypeCode]) ON [PRIMARY]
 

 CREATE  INDEX [JobSerialno] ON [dbo].[TrendForXBar]([JobSerialno]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[TrendForXBar]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[TrendForXBar]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[TrendForXBar]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[TrendForXBar]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[TrendForXBar]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [RootCauseCode] ON [dbo].[Trends]([RootCauseCode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[UHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[UHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[UHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [DepartmentUsers] ON [dbo].[Users]([DepartmentCode]) ON [PRIMARY]
 

 CREATE  INDEX [RoleUsers] ON [dbo].[Users]([RoleID]) ON [PRIMARY]
 

 CREATE  INDEX [TicketNo] ON [dbo].[Users]([TicketNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[WoQapParameter]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[WoQapParameter]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [QapPartParameterWoQapParameter] ON [dbo].[WoQapParameter]([PartNo], [ProcessCode], [PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [UnitOfMeasurementWoQapParameter] ON [dbo].[WoQapParameter]([UomCode]) ON [PRIMARY]
 

 CREATE  INDEX [WoQapParameterInterfaceCode] ON [dbo].[WoQapParameter]([InterFaceCode]) ON [PRIMARY]
 

 CREATE  INDEX [WoQapParameterPartNo] ON [dbo].[WoQapParameter]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[WoQapParameter]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[WoQapParameter]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderWoQapParameter] ON [dbo].[WoQapParameter]([WorkOrderNo], [WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[WoQapProcess]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [QapProcessWoQapProcess] ON [dbo].[WoQapProcess]([PartNo], [ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [WoQapProcessPartNo] ON [dbo].[WoQapProcess]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[WoQapProcess]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[WoQapProcess]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderWoQapProcess] ON [dbo].[WoQapProcess]([WorkOrderNo], [WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[WorkOrder]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderDate] ON [dbo].[WorkOrder]([WorkOrderDate]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[WorkOrder]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XBarRDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[XBarRDetail]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[XBarRDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XBarRHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [MachineNo] ON [dbo].[XBarRHeader]([MachineNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[XBarRHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[XBarRHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[XBarRHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[XBarRHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[XBarRHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[XBarRHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XBarSDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [SampleDateTime] ON [dbo].[XBarSDetail]([SampleDateTime]) ON [PRIMARY]
 

 CREATE  INDEX [SampleNo] ON [dbo].[XBarSDetail]([SampleNo]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[XBarSDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XBarSHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[XBarSHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[XBarSHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[XBarSHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[XBarSHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[XBarSHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[XBarSHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [ReadingNo] ON [dbo].[XDetail]([ReadingNo]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[XDetail]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[XHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[XHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[XHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[XHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[XHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[XHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XMRDetail]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [ChartSerialNumber] ON [dbo].[XMRHeader]([ChartSerialNumber]) ON [PRIMARY]
 

 CREATE  INDEX [PartNo] ON [dbo].[XMRHeader]([PartNo]) ON [PRIMARY]
 

 CREATE  INDEX [PartParaCode] ON [dbo].[XMRHeader]([PartParaCode]) ON [PRIMARY]
 

 CREATE  INDEX [ProcessCode] ON [dbo].[XMRHeader]([ProcessCode]) ON [PRIMARY]
 

 CREATE  INDEX [StationNo] ON [dbo].[XMRHeader]([StationNo]) ON [PRIMARY]
 

 CREATE  INDEX [UserCode] ON [dbo].[XMRHeader]([UserCode]) ON [PRIMARY]
 

 CREATE  INDEX [WorkOrderNo] ON [dbo].[XMRHeader]([WorkOrderNo]) ON [PRIMARY]
 

 CREATE  INDEX [Calibrationdate] ON [dbo].[fixture]([Calibrationdate]) ON [PRIMARY]
 

 CREATE  INDEX [location_code] ON [dbo].[fixture]([locationcode]) ON [PRIMARY]
 

 CREATE  INDEX [Locationfixture] ON [dbo].[fixture]([locationcode]) ON [PRIMARY]
 

 CREATE  INDEX [fixturecode] ON [dbo].[fixtureparameter]([fixturecode]) ON [PRIMARY]
 

 CREATE  INDEX [fixturefixtureparameter] ON [dbo].[fixtureparameter]([fixturecode]) ON [PRIMARY]
 

 CREATE  INDEX [partparacode] ON [dbo].[fixtureparameter]([partparacode]) ON [PRIMARY]
 

 CREATE  INDEX [PartParameterfixtureparameter] ON [dbo].[fixtureparameter]([partparacode]) ON [PRIMARY]
 

 CREATE  INDEX [fixture_code] ON [dbo].[fixtureprobes]([fixturecode]) ON [PRIMARY]
 

 CREATE  INDEX [fixturefixtureprobes] ON [dbo].[fixtureprobes]([fixturecode]) ON [PRIMARY]
 

CREATE  INDEX [JobSerialno] ON [dbo].[OutOfSpecJobReading]([JobSerialno]) ON [PRIMARY]
 

CREATE  INDEX [PartParaCode] ON [dbo].[OutOfSpecJobReading]([PartParaCode]) ON [PRIMARY]
 

CREATE  INDEX [ReadingSerialNo] ON [dbo].[OutOfSpecJobReading]([ReadingSerialNo]) ON [PRIMARY]
 

CREATE  INDEX [SampleNo] ON [dbo].[OutOfSpecJobReading]([SampleNo]) ON [PRIMARY]
 

CREATE  INDEX [SampleDate] ON [dbo].[JobSample]([SampleDate]) ON [PRIMARY]
 

CREATE  INDEX [SampleTime] ON [dbo].[JobSample]([SampleTime]) ON [PRIMARY]
 

CREATE  INDEX [PlantCode] ON [dbo].[Plants]([PlantCode]) ON [PRIMARY]
 

 CREATE  INDEX [DivCode] ON [dbo].[Divisions]([DivCode]) ON [PRIMARY]
 

 CREATE  INDEX [UnitCode] ON [dbo].[Units]([UnitCode]) ON [PRIMARY]
 

 CREATE  INDEX [LocationCode] ON [dbo].[Cells]([LocationCode]) ON [PRIMARY]
 

ALTER TABLE [dbo].[Batch] ADD 
	CONSTRAINT [Batch_FK00] FOREIGN KEY 
	(
		[WorkOrderNo],
		[WorkOrderDate]
	) REFERENCES [dbo].[WorkOrder] (
		[WorkOrderNo],
		[WorkOrderDate]
	)
 

ALTER TABLE [dbo].[BiasMapping] ADD 
	CONSTRAINT [BiasMapping_FK00] FOREIGN KEY 
	(
		[InstrumentNo]
	) REFERENCES [dbo].[Instrument] (
		[InstrumentNo]
	),
	CONSTRAINT [BiasMapping_FK01] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	),
	CONSTRAINT [BiasMapping_FK02] FOREIGN KEY 
	(
		[PartParaCode]
	) REFERENCES [dbo].[PartParameter] (
		[PartParaCode]
	)
 

ALTER TABLE [dbo].[BiasReading] ADD 
	CONSTRAINT [BiasReading_FK00] FOREIGN KEY 
	(
		[BiasMapSrNo]
	) REFERENCES [dbo].[BiasMapping] (
		[BiasMapSrNo]
	)
 

ALTER TABLE [dbo].[CustomerPart] ADD 
	CONSTRAINT [CustomerPart_FK00] FOREIGN KEY 
	(
		[CustomerCode]
	) REFERENCES [dbo].[Customer] (
		[CustomerCode]
	),
	CONSTRAINT [CustomerPart_FK01] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	)
 

ALTER TABLE [dbo].[FixtureMapping] ADD 
	CONSTRAINT [FixtureMapping_FK00] FOREIGN KEY 
	(
		[FixtureCode]
	) REFERENCES [dbo].[fixture] (
		[fixturecode]
	)
 

ALTER TABLE [dbo].[GRRMapping] ADD 
	CONSTRAINT [GRRMapping_FK00] FOREIGN KEY 
	(
		[InstrumentNo]
	) REFERENCES [dbo].[Instrument] (
		[InstrumentNo]
	),
	CONSTRAINT [GRRMapping_FK01] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	),
	CONSTRAINT [GRRMapping_FK02] FOREIGN KEY 
	(
		[PartParaCode]
	) REFERENCES [dbo].[PartParameter] (
		[PartParaCode]
	)
 

ALTER TABLE [dbo].[GRRReading] ADD 
	CONSTRAINT [GRRReading_FK00] FOREIGN KEY 
	(
		[GRRMapSrNo]
	) REFERENCES [dbo].[GRRMapping] (
		[GRRMapSrNo]
	)
 

ALTER TABLE [dbo].[HistoryJobParameter] ADD 
	CONSTRAINT [HistoryJobParameter_FK00] FOREIGN KEY 
	(
		[WorkOrderDate],
		[JobSerialno],
		[StationNo],
		[WorkOrderNo],
		[PartNo],
		[ProcessCode],
		[MachineNo]
	) REFERENCES [dbo].[HistoryJob] (
		[WorkOrderDate],
		[JobSerialno],
		[StationNo],
		[WorkOrderNo],
		[PartNo],
		[ProcessCode],
		[MachineNo]
	)
 

ALTER TABLE [dbo].[HistoryWoQapParameter] ADD 
	CONSTRAINT [HistoryWoQapParameter_FK00] FOREIGN KEY 
	(
		[WorkOrderDate],
		[WorkOrderNo]
	) REFERENCES [dbo].[HistoryWorkOrder] (
		[WorkOrderDate],
		[WorkOrderNo]
	)
 

ALTER TABLE [dbo].[HistoryWoQapProcess] ADD 
	CONSTRAINT [HistoryWoQapProcess_FK00] FOREIGN KEY 
	(
		[WorkOrderDate],
		[WorkOrderNo]
	) REFERENCES [dbo].[HistoryWorkOrder] (
		[WorkOrderDate],
		[WorkOrderNo]
	)
 

ALTER TABLE [dbo].[Instrument] ADD 
	CONSTRAINT [Instrument_FK00] FOREIGN KEY 
	(
		[InstrumentType]
	) REFERENCES [dbo].[InstrumentType] (
		[InstrumentType]
	),
	CONSTRAINT [Instrument_FK01] FOREIGN KEY 
	(
		[LocationCode]
	) REFERENCES [dbo].[Location] (
		[LocationCode]
	)
 

ALTER TABLE [dbo].[Job] ADD 
	CONSTRAINT [Job_FK00] FOREIGN KEY 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[PartNo],
		[ProcessCode]
	) REFERENCES [dbo].[WoQapProcess] (
		[WorkOrderNo],
		[WorkOrderDate],
		[PartNo],
		[ProcessCode]
	)
 

ALTER TABLE [dbo].[JobParameter] ADD 
	CONSTRAINT [JobParameter_FK00] FOREIGN KEY 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[StationNo],
		[MachineNo],
		[PartNo],
		[ProcessCode],
		[JobSerialno]
	) REFERENCES [dbo].[Job] (
		[WorkOrderNo],
		[WorkOrderDate],
		[StationNo],
		[MachineNo],
		[PartNo],
		[ProcessCode],
		[JobSerialno]
	),
	CONSTRAINT [JobParameter_FK01] FOREIGN KEY 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[PartNo],
		[ProcessCode],
		[PartParaCode]
	) REFERENCES [dbo].[WoQapParameter] (
		[WorkOrderNo],
		[WorkOrderDate],
		[PartNo],
		[ProcessCode],
		[PartParaCode]
	)
 

ALTER TABLE [dbo].[LinearityMappingDetail] ADD 
	CONSTRAINT [LinearityMappingDetail_FK00] FOREIGN KEY 
	(
		[LinearityMapSrNo]
	) REFERENCES [dbo].[LinearityMappingMaster] (
		[LinearityMapSrNo]
	),
	CONSTRAINT [LinearityMappingDetail_FK01] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	),
	CONSTRAINT [LinearityMappingDetail_FK02] FOREIGN KEY 
	(
		[PartParaCode]
	) REFERENCES [dbo].[PartParameter] (
		[PartParaCode]
	)
 

ALTER TABLE [dbo].[LinearityMappingMaster] ADD 
	CONSTRAINT [LinearityMappingMaster_FK00] FOREIGN KEY 
	(
		[InstrumentNo]
	) REFERENCES [dbo].[Instrument] (
		[InstrumentNo]
	)
 

ALTER TABLE [dbo].[LinearityReading] ADD 
	CONSTRAINT [LinearityReading_FK00] FOREIGN KEY 
	(
		[LinearityMapSrNo],
		[PartNo],
		[PartParaCode]
	) REFERENCES [dbo].[LinearityMappingDetail] (
		[LinearityMapSrNo],
		[PartNo],
		[PartParaCode]
	)
 

ALTER TABLE [dbo].[Machine] ADD 
	CONSTRAINT [Machine_FK00] FOREIGN KEY 
	(
		[Machinetype]
	) REFERENCES [dbo].[MachineType] (
		[Machinetype]
	)
 

ALTER TABLE [dbo].[MachineOperation] ADD 
	CONSTRAINT [MachineOperation_FK00] FOREIGN KEY 
	(
		[MachineNo]
	) REFERENCES [dbo].[Machine] (
		[MachineNo]
	),
	CONSTRAINT [MachineOperation_FK01] FOREIGN KEY 
	(
		[ProcessCode]
	) REFERENCES [dbo].[Process] (
		[ProcessCode]
	)
 

ALTER TABLE [dbo].[ModelShiftTarget] ADD 
	CONSTRAINT [ModelShiftTarget_FK00] FOREIGN KEY 
	(
		[MachineNo]
	) REFERENCES [dbo].[Machine] (
		[MachineNo]
	),
	CONSTRAINT [ModelShiftTarget_FK01] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	),
	CONSTRAINT [ModelShiftTarget_FK02] FOREIGN KEY 
	(
		[ShiftCode]
	) REFERENCES [dbo].[Shift] (
		[ShiftCode]
	)
 

ALTER TABLE [dbo].[ModelToolLife] ADD 
	CONSTRAINT [ModelToolLife_FK00] FOREIGN KEY 
	(
		[MachineNO],
		[ProcessCode]
	) REFERENCES [dbo].[MachineOperation] (
		[MachineNo],
		[ProcessCode]
	),
	CONSTRAINT [ModelToolLife_FK01] FOREIGN KEY 
	(
		[PartNO]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	)
 

ALTER TABLE [dbo].[ModelToolLinkRange] ADD 
	CONSTRAINT [ModelToolLinkRange_FK00] FOREIGN KEY 
	(
		[MachineNo],
		[ProcessCode]
	) REFERENCES [dbo].[MachineOperation] (
		[MachineNo],
		[ProcessCode]
	),
	CONSTRAINT [ModelToolLinkRange_FK01] FOREIGN KEY 
	(
		[ProcessCode],
		[ToolTypeCode],
		[ParaCode]
	) REFERENCES [dbo].[OperationToolLinkParameter] (
		[ProcessCode],
		[ToolTypeCode],
		[ParaCode]
	),
	CONSTRAINT [ModelToolLinkRange_FK02] FOREIGN KEY 
	(
		[PartNO]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	)
 

ALTER TABLE [dbo].[NonConformities] ADD 
	CONSTRAINT [NonConformities_FK00] FOREIGN KEY 
	(
		[WorkOrderNo],
		[WorkOrderDate],
		[StationNo],
		[PartNo],
		[ProcessCode],
		[JobSerialno],
		[MachineNo],
		[PartParaCode],
		[ServerId]
	) REFERENCES [dbo].[JobParameter] (
		[WorkOrderNo],
		[WorkOrderDate],
		[StationNo],
		[PartNo],
		[ProcessCode],
		[JobSerialno],
		[MachineNo],
		[PartParaCode],
		[ServerId]
	)
 

ALTER TABLE [dbo].[OperationToolLink] ADD 
	CONSTRAINT [OperationToolLink_FK00] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	)
 

ALTER TABLE [dbo].[OperationToolLinkParameter] ADD 
	CONSTRAINT [OperationToolLinkParamete_FK00] FOREIGN KEY 
	(
		[ProcessCode],
		[ToolTypeCode]
	) REFERENCES [dbo].[OperationToolLink] (
		[ProcessCode],
		[ToolTypeCode]
	),
	CONSTRAINT [OperationToolLinkParamete_FK01] FOREIGN KEY 
	(
		[ToolTypeCode],
		[ParaCode]
	) REFERENCES [dbo].[ToolTypeParameter] (
		[ToolTypeCode],
		[ParaCode]
	),
	CONSTRAINT [OperationToolLinkParamete_FK02] FOREIGN KEY 
	(
		[UomCode]
	) REFERENCES [dbo].[UnitOfMeasurement] (
		[UomCode]
	)
 

ALTER TABLE [dbo].[Parameter] ADD 
	CONSTRAINT [Parameter_FK00] FOREIGN KEY 
	(
		[ParaTypeCode]
	) REFERENCES [dbo].[ParameterType] (
		[ParaTypeCode]
	)
 

ALTER TABLE [dbo].[PartMachine] ADD 
	CONSTRAINT [PartMachine_FK00] FOREIGN KEY 
	(
		[MachineNo]
	) REFERENCES [dbo].[Machine] (
		[MachineNo]
	),
	CONSTRAINT [PartMachine_FK01] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	)
 

ALTER TABLE [dbo].[PartParameterGRR] ADD 
	CONSTRAINT [PartParameterGRR_FK00] FOREIGN KEY 
	(
		[ParameterCode]
	) REFERENCES [dbo].[PartParameter] (
		[PartParaCode]
	),
	CONSTRAINT [PartParameterGRR_FK01] FOREIGN KEY 
	(
		[PartCode]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	),
	CONSTRAINT [PartParameterGRR_FK02] FOREIGN KEY 
	(
		[OperatorCode]
	) REFERENCES [dbo].[Users] (
		[UserCode]
	)
 

ALTER TABLE [dbo].[Production] ADD 
	CONSTRAINT [Production_FK00] FOREIGN KEY 
	(
		[ShiftCode]
	) REFERENCES [dbo].[Shift] (
		[ShiftCode]
	),
	CONSTRAINT [Production_FK01] FOREIGN KEY 
	(
		[supervisorcode]
	) REFERENCES [dbo].[Supervisor] (
		[SupervisorCode]
	)
 

ALTER TABLE [dbo].[QapPartParameter] ADD 
	CONSTRAINT [QapPartParameter_FK00] FOREIGN KEY 
	(
		[PartParaCode]
	) REFERENCES [dbo].[PartParameter] (
		[PartParaCode]
	),
	CONSTRAINT [QapPartParameter_FK01] FOREIGN KEY 
	(
		[UomCode]
	) REFERENCES [dbo].[UnitOfMeasurement] (
		[UomCode]
	)
 

ALTER TABLE [dbo].[QapProcess] ADD 
	CONSTRAINT [QapProcess_FK00] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	),
	CONSTRAINT [QapProcess_FK01] FOREIGN KEY 
	(
		[ProcessCode]
	) REFERENCES [dbo].[Process] (
		[ProcessCode]
	)
 

ALTER TABLE [dbo].[Readings] ADD 
	CONSTRAINT [Readings_FK00] FOREIGN KEY 
	(
		[SerialNo]
	) REFERENCES [dbo].[PartParameterGRR] (
		[SerialNo]
	),
	CONSTRAINT [Readings_FK01] FOREIGN KEY 
	(
		[OperatorCode]
	) REFERENCES [dbo].[Users] (
		[UserCode]
	)
 

ALTER TABLE [dbo].[RootCauseDetail] ADD 
	CONSTRAINT [RootCauseDetail_FK00] FOREIGN KEY 
	(
		[RootCauseCode]
	) REFERENCES [dbo].[RootCause] (
		[RootCauseCode]
	)
 

ALTER TABLE [dbo].[StabilityMapping] ADD 
	CONSTRAINT [StabilityMapping_FK00] FOREIGN KEY 
	(
		[InstrumentNo]
	) REFERENCES [dbo].[Instrument] (
		[InstrumentNo]
	),
	CONSTRAINT [StabilityMapping_FK01] FOREIGN KEY 
	(
		[PartParaCode]
	) REFERENCES [dbo].[PartParameter] (
		[PartParaCode]
	),
	CONSTRAINT [StabilityMapping_FK02] FOREIGN KEY 
	(
		[PartNo]
	) REFERENCES [dbo].[Part] (
		[PartNo]
	)
 

ALTER TABLE [dbo].[StabilityReading] ADD 
	CONSTRAINT [StabilityReading_FK00] FOREIGN KEY 
	(
		[StabilityMapSrNo]
	) REFERENCES [dbo].[StabilityMapping] (
		[StabilityMapSrNo]
	)
 

ALTER TABLE [dbo].[Supervisor] ADD 
	CONSTRAINT [Supervisor_FK00] FOREIGN KEY 
	(
		[SupervisorCode]
	) REFERENCES [dbo].[Users] (
		[UserCode]
	)
 

ALTER TABLE [dbo].[Tool] ADD 
	CONSTRAINT [Tool_FK00] FOREIGN KEY 
	(
		[ToolTypeCode]
	) REFERENCES [dbo].[ToolType] (
		[TooltypeCode]
	)
 

ALTER TABLE [dbo].[ToolIssueParameterHist] ADD 
	CONSTRAINT [ToolIssueParameterHist_FK00] FOREIGN KEY 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNo]
	) REFERENCES [dbo].[ToolIssueHist] (
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNo]
	)
 

ALTER TABLE [dbo].[ToolIssueParameters] ADD 
	CONSTRAINT [ToolIssueParameters_FK00] FOREIGN KEY 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo]
	) REFERENCES [dbo].[ToolIssue] (
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo]
	)
 

ALTER TABLE [dbo].[ToolParaChangeDetail] ADD 
	CONSTRAINT [ToolParaChangeDetail_FK00] FOREIGN KEY 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[ParaSerialNo]
	) REFERENCES [dbo].[ToolParaChange] (
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[ParaSerialNo]
	)
 

ALTER TABLE [dbo].[ToolParaChangeDtlHist] ADD 
	CONSTRAINT [ToolParaChangeDtlHist_FK00] FOREIGN KEY 
	(
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNO],
		[ParaSerialNo]
	) REFERENCES [dbo].[ToolParaChangeHist] (
		[PartNo],
		[MachineNo],
		[ProcessCode],
		[ToolCode],
		[RegroundSerialNo],
		[PartSerialNo],
		[ParaSerialNo]
	)
 

ALTER TABLE [dbo].[ToolTypeParameter] ADD 
	CONSTRAINT [ToolTypeParameter_FK00] FOREIGN KEY 
	(
		[ParaCode]
	) REFERENCES [dbo].[Parameter] (
		[ParaCode]
	),
	CONSTRAINT [ToolTypeParameter_FK01] FOREIGN KEY 
	(
		[ToolTypeCode]
	) REFERENCES [dbo].[ToolType] (
		[TooltypeCode]
	)
 

ALTER TABLE [dbo].[Users] ADD 
	CONSTRAINT [Users_FK00] FOREIGN KEY 
	(
		[DepartmentCode]
	) REFERENCES [dbo].[Department] (
		[DepartmentCode]
	),
	CONSTRAINT [Users_FK01] FOREIGN KEY 
	(
		[RoleID]
	) REFERENCES [dbo].[Role] (
		[RoleID]
	)
 

ALTER TABLE [dbo].[WoQapParameter] ADD 
	CONSTRAINT [WoQapParameter_FK00] FOREIGN KEY 
	(
		[PartNo],
		[ProcessCode],
		[PartParaCode]
	) REFERENCES [dbo].[QapPartParameter] (
		[PartNo],
		[ProcessCode],
		[PartParaCode]
	),
	CONSTRAINT [WoQapParameter_FK01] FOREIGN KEY 
	(
		[UomCode]
	) REFERENCES [dbo].[UnitOfMeasurement] (
		[UomCode]
	),
	CONSTRAINT [WoQapParameter_FK02] FOREIGN KEY 
	(
		[WorkOrderNo],
		[WorkOrderDate]
	) REFERENCES [dbo].[WorkOrder] (
		[WorkOrderNo],
		[WorkOrderDate]
	)
 

ALTER TABLE [dbo].[WoQapProcess] ADD 
	CONSTRAINT [WoQapProcess_FK00] FOREIGN KEY 
	(
		[PartNo],
		[ProcessCode]
	) REFERENCES [dbo].[QapProcess] (
		[PartNo],
		[ProcessCode]
	),
	CONSTRAINT [WoQapProcess_FK01] FOREIGN KEY 
	(
		[WorkOrderNo],
		[WorkOrderDate]
	) REFERENCES [dbo].[WorkOrder] (
		[WorkOrderNo],
		[WorkOrderDate]
	)
 

ALTER TABLE [dbo].[fixtureparameter] ADD 
	CONSTRAINT [fixtureparameter_FK00] FOREIGN KEY 
	(
		[fixturecode]
	) REFERENCES [dbo].[fixture] (
		[fixturecode]
	),
	CONSTRAINT [fixtureparameter_FK01] FOREIGN KEY 
	(
		[partparacode]
	) REFERENCES [dbo].[PartParameter] (
		[PartParaCode]
	)
 

ALTER TABLE [dbo].[fixtureprobes] ADD 
	CONSTRAINT [fixtureprobes_FK00] FOREIGN KEY 
	(
		[fixturecode]
	) REFERENCES [dbo].[fixture] (
		[fixturecode]
	)
 

ALTER TABLE [dbo].[Divisions] ADD 
	CONSTRAINT [Divisions_FK00] FOREIGN KEY 
	(
		[PlantCode]
	) REFERENCES [dbo].[Plants] (		
		[PlantCode]
	)
 

ALTER TABLE [dbo].[Units] ADD 
	CONSTRAINT [Units_FK00] FOREIGN KEY 
	(
		[PlantCode]
	) REFERENCES [dbo].[Plants] (		
		[PlantCode]
	),
	CONSTRAINT [Units_FK01] FOREIGN KEY 
	(
		[DivCode]
	) REFERENCES [dbo].[Divisions] (		
		[DivCode]
	)
 

ALTER TABLE [dbo].[Cells] ADD 
	CONSTRAINT [Cells_FK00] FOREIGN KEY 
	(
		[PlantCode]
	) REFERENCES [dbo].[Plants] (		
		[PlantCode]
	),
	CONSTRAINT [Cells_FK01] FOREIGN KEY 
	(
		[DivCode]
	) REFERENCES [dbo].[Divisions] (		
		[DivCode]
	),
	CONSTRAINT [Cells_FK02] FOREIGN KEY 
	(
		[UnitCode]
	) REFERENCES [dbo].[Units] (		
		[UnitCode]
	)
 

ALTER TABLE [dbo].[President] ADD 
	CONSTRAINT [President_FK00] FOREIGN KEY 
	(
		[PlantCode]
	) REFERENCES [dbo].[Plants] (		
		[PlantCode]
	)
 

ALTER TABLE [dbo].[GManager] ADD 
	CONSTRAINT [GManager_FK00] FOREIGN KEY 
	(
		[PlantCode]
	) REFERENCES [dbo].[Plants] (		
		[PlantCode]
	),
	CONSTRAINT [GManager_FK01] FOREIGN KEY 
	(
		[PresidentCode]
	) REFERENCES [dbo].[President] (		
		[PresidentCode]
	)
 

ALTER TABLE [dbo].[UManager] ADD 
	CONSTRAINT [UManagers_FK00] FOREIGN KEY 
	(
		[PlantCode]
	) REFERENCES [dbo].[Plants] (		
		[PlantCode]
	),
	CONSTRAINT [UManager_FK01] FOREIGN KEY 
	(
		[PresidentCode]
	) REFERENCES [dbo].[President] (		
		[PresidentCode]
	),
	CONSTRAINT [UManager_FK02] FOREIGN KEY 
	(
		[GManagerCode]
	) REFERENCES [dbo].[GManager] (		
		[GManagerCode]	
	)
 