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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE [dbo].[BomBase] (
	[prodnr] [nvarchar] (20) NOT NULL ,
	[Version] [float] NOT NULL ,
	[Descript] [nvarchar] (40) NULL ,
	[Spec] [nvarchar] (50) NULL ,
	[photo] [nvarchar] (100) NULL ,
	[PicNum] [nvarchar] (20) NULL ,
	[MainUnit] [nvarchar] (10) NOT NULL ,
	[Build_psn] [nvarchar] (10) NULL ,
	[BuildTime] [datetime] NULL ,
	[Publish] [bit] NOT NULL ,
	[PublishTime] [datetime] NULL ,
	[StopPublishTime] [datetime] NULL ,
	[make] [nvarchar] (15) NOT NULL ,
	[makeDate] [datetime] NOT NULL ,
	[consignment] [nvarchar] (15) NULL ,
	[signDate] [datetime] NULL ,
	[againsign] [nvarchar] (15) NULL ,
	[againsignDate] [datetime] NULL ,
	[updatetime] [datetime] NULL ,
	[updateby] [nvarchar] (10) NULL ,
	[Cspecmemo] [ntext] NULL ,
	[Especmemo] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[BomInsPostion] (
	[Prodnr] [nvarchar] (20) NULL ,
	[Version] [float] NULL ,
	[Masternr] [nvarchar] (20) NULL ,
	[Postion] [nvarchar] (20) NULL ,
	[Comment] [nvarchar] (50) NULL ,
	[MVersion] [float] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[BomProduct] (
	[Prodnr] [nvarchar] (20) NULL ,
	[SeriesNr] [nvarchar] (3) NOT NULL ,
	[Version] [float] NULL ,
	[Masternr] [nvarchar] (20) NULL ,
	[MVersion] [float] NULL ,
	[Descript] [nvarchar] (40) NULL ,
	[Spec] [nvarchar] (50) NULL ,
	[unicost] [money] NULL ,
	[MainUnit] [nvarchar] (10) NULL ,
	[MainQty] [float] NULL ,
	[MasterQty] [float] NULL ,
	[LossRate] [float] NULL ,
	[PhysicalQty] [float] NULL ,
	[Cspecmemo] [ntext] NULL ,
	[Especmemo] [ntext] NULL ,
	[Provider] [nvarchar] (50) NULL ,
	[ProviderNr] [nvarchar] (20) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[BomReplace] (
	[Prodnr] [nvarchar] (20) NULL ,
	[Version] [float] NULL ,
	[Masternr] [nvarchar] (20) NULL ,
	[RProdnr] [nvarchar] (20) NULL ,
	[Level] [int] NULL ,
	[Descript] [nvarchar] (40) NULL ,
	[Spec] [nvarchar] (50) NULL ,
	[MainUnit] [nvarchar] (10) NOT NULL ,
	[MainQty] [float] NULL ,
	[MasterQty] [float] NULL ,
	[LossRate] [float] NULL ,
	[PhysicalQty] [float] NULL ,
	[Cspecmemo] [ntext] NULL ,
	[Especmemo] [ntext] NULL ,
	[MVersion] [float] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CodeClass] (
	[ZCLASS_ID] [int] NOT NULL ,
	[ZUCODE] [nvarchar] (50) NULL ,
	[ZNAMEC] [nvarchar] (60) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Codes] (
	[ZCLASS_ID] [int] NOT NULL ,
	[ZUCODE] [varchar] (15) NOT NULL ,
	[ZNAMEC] [varchar] (60) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CompanyInfo] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Code] [nvarchar] (20) NULL ,
	[E_Name_Short] [nvarchar] (20) NULL ,
	[E_Name] [nvarchar] (100) NULL ,
	[C_Name_Short] [nvarchar] (20) NULL ,
	[C_Name] [nvarchar] (100) NULL ,
	[E_Address] [nvarchar] (100) NULL ,
	[C_Address] [nvarchar] (100) NULL ,
	[Fax] [nvarchar] (20) NULL ,
	[Tel] [nvarchar] (20) NULL ,
	[E-Mail] [nvarchar] (50) NULL ,
	[HomePage] [nvarchar] (50) NULL ,
	[ProdnrPhotoPath] [nvarchar] (100) NULL ,
	[Alocation] [bit] NULL ,
	[OutgoodsByStk] [nvarchar] (2) NULL ,
	[OutgoodsByCrd] [nvarchar] (2) NULL ,
	[OutPrice] [nvarchar] (2) NULL ,
	[AttnPhotoPath] [nvarchar] (100) NULL ,
	[ReportFilePath] [nvarchar] (100) NULL ,
	[DefaultDepNo] [nvarchar] (5) NULL ,
	[Ver] [nvarchar] (50) NULL ,
	[UpdateDate] [datetime] NULL ,
	[E_Address_Company] [nvarchar] (50) NULL ,
	[E_Address_Area] [nvarchar] (50) NULL ,
	[E_Address_Town] [nvarchar] (50) NULL ,
	[DefaultAccDepNo] [nvarchar] (5) NULL ,
	[CompanyLog] [image] NULL ,
	[CtrlMaterial] [bit] NOT NULL ,
	[Destination] [nvarchar] (200) NULL ,
	[OverConfirm] [bit] NOT NULL ,
	[ProvideControl] [bit] NOT NULL ,
	[CtrlMouldStatus] [bit] NOT NULL ,
	[CtrlMouldStore] [bit] NOT NULL ,
	[customcode] [nvarchar] (200) NULL ,
	[serverhost] [nvarchar] (20) NULL ,
	[PrintType] [nvarchar] (10) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Currency] (
	[RowID] [int] IDENTITY (1, 1) NOT NULL ,
	[CurrencyNo] [nvarchar] (10) NULL ,
	[CurrencyName] [nvarchar] (50) NULL ,
	[Rate] [float] NOT NULL ,
	[IsBase] [bit] NOT NULL ,
	[Upd_By] [nvarchar] (20) NULL ,
	[Update_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CustomerBase] (
	[customernr] [nvarchar] (50) NOT NULL ,
	[customername] [nvarchar] (50) NULL ,
	[customerbrief] [nvarchar] (50) NULL ,
	[address1] [nvarchar] (50) NULL ,
	[address2] [nvarchar] (50) NULL ,
	[address3] [nvarchar] (50) NULL ,
	[encustomername] [nvarchar] (50) NULL ,
	[encustomerbrief] [nvarchar] (50) NULL ,
	[enaddress1] [nvarchar] (50) NULL ,
	[enaddress2] [nvarchar] (50) NULL ,
	[enaddress3] [nvarchar] (50) NULL ,
	[currency_id] [nvarchar] (50) NULL ,
	[gstnr] [nvarchar] (50) NULL ,
	[ISO1] [nvarchar] (50) NULL ,
	[ISO2] [nvarchar] (50) NULL ,
	[fax] [nvarchar] (50) NULL ,
	[tel] [nvarchar] (50) NULL ,
	[email] [nvarchar] (50) NULL ,
	[homepage] [nvarchar] (50) NULL ,
	[sale_nr] [nvarchar] (50) NULL ,
	[updatetime] [datetime] NULL ,
	[updateby] [nvarchar] (50) NULL ,
	[attachmemo] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Depart] (
	[Dep_No] [nvarchar] (50) NOT NULL ,
	[Dep_Na] [nvarchar] (50) NULL ,
	[Position] [nvarchar] (50) NULL ,
	[Phone] [nvarchar] (50) NULL ,
	[IsStoreHouse] [bit] NULL ,
	[WhouseMRP] [int] NULL ,
	[WhouseType] [int] NULL ,
	[Upd_By] [nvarchar] (50) NULL ,
	[Update_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[DepartDetail] (
	[Dep_No] [varchar] (4) NOT NULL ,
	[Pos_No] [varchar] (20) NOT NULL ,
	[Pos_Na] [varchar] (30) NULL ,
	[Pos_Memo] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[DotInfo] (
	[DotNr] [nchar] (2) NOT NULL ,
	[QtyDot] [smallint] NULL ,
	[LpriceDot] [smallint] NULL ,
	[FpriceDot] [smallint] NULL ,
	[LAmountDot] [smallint] NULL ,
	[FAmountDot] [smallint] NULL ,
	[TaxDot] [smallint] NULL ,
	[LTaxAmountDot] [smallint] NULL ,
	[LCostDot] [smallint] NULL ,
	[FCostDot] [smallint] NULL ,
	[DiscountDot] [smallint] NULL ,
	[ExchangeDot] [smallint] NULL ,
	[BomRateQtyDot] [smallint] NULL ,
	[BomQtyDot] [smallint] NULL ,
	[WorkTimeDot] [smallint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[EmpPerson] (
	[P_no] [varchar] (10) NOT NULL ,
	[P_na] [nvarchar] (16) NULL ,
	[Sex] [varchar] (2) NULL ,
	[Depart] [varchar] (4) NULL ,
	[Id_no] [varchar] (20) NULL ,
	[Id_validate] [datetime] NULL ,
	[Bird] [datetime] NULL ,
	[Ent_ti] [datetime] NULL ,
	[Real_Ent_ti] [datetime] NULL ,
	[Ic_no] [int] NULL ,
	[Home] [varchar] (50) NULL ,
	[Mail] [varchar] (6) NULL ,
	[Na_pl] [varchar] (6) NULL ,
	[Nation] [varchar] (2) NULL ,
	[Marry] [varchar] (4) NULL ,
	[Study] [varchar] (2) NULL ,
	[School] [varchar] (30) NULL ,
	[L_man] [varchar] (8) NULL ,
	[L_tel] [varchar] (20) NULL ,
	[Class] [varchar] (4) NULL ,
	[Duty] [varchar] (3) NULL ,
	[Sal_ty] [varchar] (1) NULL ,
	[Dorm] [varchar] (4) NULL ,
	[Bed] [varchar] (2) NULL ,
	[Bc] [varchar] (62) NULL ,
	[Bc1] [varchar] (62) NULL ,
	[Brush] [varchar] (1) NULL ,
	[Bank_no] [varchar] (20) NULL ,
	[Bank_nm] [varchar] (16) NULL ,
	[Provice] [varchar] (20) NULL ,
	[County] [varchar] (50) NULL ,
	[Ent_validate] [datetime] NULL ,
	[Stay_document] [varchar] (16) NULL ,
	[Stay_validate] [datetime] NULL ,
	[Bargain_validate] [datetime] NULL ,
	[Insureance] [bit] NULL ,
	[WorkHurt] [bit] NULL ,
	[LostWork] [bit] NULL ,
	[Medic] [bit] NULL ,
	[Mach_no] [varchar] (10) NULL ,
	[Photo] [image] NULL ,
	[Upd_By] [varchar] (20) NULL ,
	[Update_Date] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[FaceBase_Quote] (
	[FaceNo] [nvarchar] (10) NULL ,
	[FaceName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Unit] [nvarchar] (10) NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[FaceCost_Quote] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[MaterialNo] [nvarchar] (20) NOT NULL ,
	[ProdName] [nvarchar] (50) NULL ,
	[RowID] [int] NOT NULL ,
	[QuoteNo] [nvarchar] (20) NULL ,
	[FaceNo] [nvarchar] (10) NULL ,
	[FaceName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Unit] [nvarchar] (10) NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL ,
	[Cost] [money] NULL ,
	[IsWeightAvg] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[FreightBase_Quote] (
	[FreightNo] [nvarchar] (10) NULL ,
	[FreightName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Qty] [int] NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[FreightCost_Quote] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[MaterialNo] [nvarchar] (20) NOT NULL ,
	[ProdName] [nvarchar] (50) NULL ,
	[RowID] [int] NOT NULL ,
	[QuoteNo] [nvarchar] (50) NULL ,
	[FreightNo] [nvarchar] (10) NULL ,
	[FreightName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Qty] [int] NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL ,
	[Cost] [money] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[GroupObject] (
	[Group_Id] [int] NULL ,
	[Object_Id] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[GroupPrivilege] (
	[Group_Id] [int] NULL ,
	[Object_Id] [int] NULL ,
	[Method_Id] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[GroupUser] (
	[Group_Id] [int] NULL ,
	[User_Id] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Groups] (
	[Group_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Group_Code] [nvarchar] (20) NOT NULL ,
	[Group_Name] [nvarchar] (20) NOT NULL ,
	[Group_Script] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[InventoryBase] (
	[prodnr] [varchar] (50) NOT NULL ,
	[Type] [varchar] (50) NOT NULL ,
	[Type2] [int] NULL ,
	[UseDate] [datetime] NULL ,
	[LostDate] [datetime] NULL ,
	[Descript] [varchar] (50) NULL ,
	[EDescript] [varchar] (50) NULL ,
	[spec] [varchar] (50) NULL ,
	[Espec] [varchar] (50) NULL ,
	[MainUnit] [varchar] (50) NULL ,
	[SecUnit] [varchar] (50) NULL ,
	[UnitFactor] [float] NULL ,
	[Scost] [money] NULL ,
	[unicost] [money] NULL ,
	[uniprice] [money] NULL ,
	[Alocation] [bit] NULL ,
	[updatetime] [datetime] NULL ,
	[updateby] [varchar] (50) NULL ,
	[prodclass] [varchar] (50) NULL ,
	[DefaultProviderNr] [varchar] (50) NULL ,
	[MakeLine] [varchar] (50) NULL ,
	[photo] [varchar] (100) NULL ,
	[PicNum] [varchar] (50) NULL ,
	[unittype] [varchar] (50) NULL ,
	[heavunit] [varchar] (50) NULL ,
	[cuftunit] [varchar] (50) NULL ,
	[maingw] [float] NULL ,
	[mainnw] [float] NULL ,
	[mainBoxFactor] [float] NULL ,
	[mainctnunit] [varchar] (50) NULL ,
	[mainctncuftl] [float] NULL ,
	[mainctncuftw] [float] NULL ,
	[mainctncufth] [float] NULL ,
	[mainctnCuft] [float] NULL ,
	[mainctnnw] [float] NULL ,
	[mainctngw] [float] NULL ,
	[gw] [float] NULL ,
	[nw] [float] NULL ,
	[BoxFactor] [float] NULL ,
	[ctnunit] [varchar] (50) NULL ,
	[ctncuftl] [float] NULL ,
	[ctncuftw] [float] NULL ,
	[ctncufth] [float] NULL ,
	[ctnCuft] [float] NULL ,
	[ctnnw] [float] NULL ,
	[ctngw] [float] NULL ,
	[PreInQty] [float] NULL ,
	[PreOutQty] [float] NULL ,
	[UseQty] [float] NULL ,
	[InvBsCtm1] [varchar] (50) NULL ,
	[InvBsCtm2] [varchar] (50) NULL ,
	[InvBsCtm3] [varchar] (50) NULL ,
	[ctnsizetype] [smallint] NULL ,
	[heaviness] [float] NULL ,
	[Cspecmemo] [text] NULL ,
	[Especmemo] [text] NULL ,
	[MainCuftl] [float] NULL ,
	[MainCuftw] [float] NULL ,
	[MainCufth] [float] NULL ,
	[MainCuft] [float] NULL ,
	[Cuftl] [float] NULL ,
	[Cuftw] [float] NULL ,
	[Cufth] [float] NULL ,
	[Cuft] [float] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MachineBase] (
	[MachinNr] [nvarchar] (50) NULL ,
	[MachinName] [nvarchar] (50) NULL ,
	[Depart] [nvarchar] (4) NULL ,
	[Drive] [nvarchar] (50) NULL ,
	[UpModeTime] [float] NULL ,
	[DownModeTime] [int] NULL ,
	[Upd_By] [nvarchar] (20) NULL ,
	[Update_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MaterialCost_Quote] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[MaterialNo] [nvarchar] (20) NOT NULL ,
	[ProdName] [nvarchar] (50) NULL ,
	[Price] [float] NULL ,
	[Qty] [float] NULL ,
	[Wasting] [float] NULL ,
	[Density] [float] NULL ,
	[DefaultProviderNr] [nvarchar] (50) NULL ,
	[Cost] [float] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Methods] (
	[Method_Id] [int] NOT NULL ,
	[Method_Code] [nvarchar] (20) NULL ,
	[Method_Name_P] [nvarchar] (20) NULL ,
	[Method_Name] [nvarchar] (20) NULL ,
	[Method_Order] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldBase] (
	[prodnr] [nvarchar] (20) NOT NULL ,
	[descript] [nvarchar] (60) NOT NULL ,
	[type] [nvarchar] (8) NULL ,
	[papernr] [nvarchar] (20) NULL ,
	[unitqty] [int] NULL ,
	[ttlqty] [int] NULL ,
	[ttltimes] [int] NULL ,
	[inittimes] [int] NULL ,
	[productnr] [nvarchar] (20) NULL ,
	[locatenr] [nvarchar] (20) NULL ,
	[departnr] [nvarchar] (20) NULL ,
	[createdate] [datetime] NULL ,
	[lastmodifydate] [datetime] NULL ,
	[state] [nvarchar] (2) NULL ,
	[cmemo] [ntext] NULL ,
	[owner_id] [nvarchar] (10) NULL ,
	[owner_code] [nvarchar] (50) NULL ,
	[relativeqty] [int] NULL ,
	[laststatedate] [datetime] NULL ,
	[makedate] [datetime] NULL ,
	[maker] [nvarchar] (7) NULL ,
	[MouldPicFile] [nvarchar] (255) NULL ,
	[RefPicFile] [nvarchar] (255) NULL ,
	[statememo] [ntext] NULL ,
	[projectName] [nvarchar] (50) NULL ,
	[ttlage] [int] NULL ,
	[weihuqty] [int] NULL ,
	[punchqty] [int] NULL ,
	[weihuttl] [int] NULL ,
	[IsBack] [bit] NOT NULL ,
	[gx_prodnr] [nvarchar] (20) NULL ,
	[SeriesNo] [nvarchar] (5) NULL ,
	[MouldSet] [nvarchar] (20) NULL ,
	[CustomProdnr] [nvarchar] (20) NULL ,
	[origlocal] [nvarchar] (20) NULL ,
	[unitqtymemo] [nvarchar] (50) NULL ,
	[safeage] [int] NULL ,
	[Vendor] [nvarchar] (50) NULL ,
	[Dim] [nvarchar] (50) NULL ,
	[Ton] [nvarchar] (50) NULL ,
	[Weight] [nvarchar] (20) NULL ,
	[Coffer] [nvarchar] (20) NULL ,
	[InRecordFile] [nvarchar] (255) NULL ,
	[RefPicFile2] [nvarchar] (255) NULL ,
	[Pagelocatenr] [nvarchar] (20) NULL ,
	[Picture] [nvarchar] (255) NULL ,
	[CommendMachine1] [nvarchar] (20) NULL ,
	[CommendMachine2] [nvarchar] (20) NULL ,
	[FuBanDate] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldBaseCurrent] (
	[prodnr] [nvarchar] (20) NOT NULL ,
	[CurrentProdNr] [nvarchar] (20) NOT NULL ,
	[PushRate] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldBaseUse] (
	[prodnr] [nvarchar] (20) NOT NULL ,
	[Useprodnr] [nvarchar] (20) NOT NULL ,
	[PushRate] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldChgStatusBase] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[chgdate] [datetime] NULL ,
	[chger] [nvarchar] (7) NULL ,
	[makedate] [datetime] NULL ,
	[maker] [nvarchar] (7) NULL ,
	[CMemo] [ntext] NULL ,
	[updateby] [nvarchar] (7) NULL ,
	[updatetime] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldChgStatusProduct] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[OldStatus] [nvarchar] (3) NULL ,
	[NewStatus] [nvarchar] (3) NULL ,
	[chgReason] [nvarchar] (100) NULL ,
	[cmemo] [ntext] NULL ,
	[OldStateMemo] [nvarchar] (100) NULL ,
	[OldLastStateDate] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldCostBase] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[ProdNr] [nvarchar] (20) NULL ,
	[descript] [nvarchar] (60) NULL ,
	[MakeCost] [float] NULL ,
	[RMakeCost] [float] NULL ,
	[MasterCost] [float] NULL ,
	[ManageCost] [float] NULL ,
	[OtherCost] [float] NULL ,
	[make] [nvarchar] (15) NULL ,
	[makeDate] [datetime] NULL ,
	[consignment] [nvarchar] (15) NULL ,
	[signDate] [datetime] NULL ,
	[againsign] [nvarchar] (15) NULL ,
	[againsignDate] [datetime] NULL ,
	[UpdateBy] [nvarchar] (10) NULL ,
	[UpdateTime] [datetime] NULL ,
	[StatusNo] [nvarchar] (10) NULL ,
	[SoInvseriesNr] [nvarchar] (13) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldCostProduct] (
	[ID] [nvarchar] (38) NOT NULL ,
	[invseriesnr] [nvarchar] (13) NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[seriesnr] [nvarchar] (3) NULL ,
	[Prodnr] [nvarchar] (20) NULL ,
	[descript] [nvarchar] (60) NULL ,
	[CostType] [int] NULL ,
	[Cost] [float] NULL ,
	[TypeNr] [nvarchar] (2) NULL ,
	[ChargeType] [nvarchar] (2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldInOutBase] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[Ivdate] [datetime] NOT NULL ,
	[WorkerNr] [nvarchar] (50) NULL ,
	[WorkerName] [nvarchar] (20) NULL ,
	[make] [nvarchar] (15) NULL ,
	[makeDate] [datetime] NULL ,
	[updateby] [nvarchar] (10) NULL ,
	[updatetime] [datetime] NULL ,
	[cmemo] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldInOutProduct] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[descript] [nvarchar] (50) NULL ,
	[whousenr] [nvarchar] (4) NULL ,
	[soinvseriesnr] [nvarchar] (13) NULL ,
	[soseriersnr] [nvarchar] (3) NULL ,
	[PauseArea] [nvarchar] (10) NULL ,
	[SourceWhourseNr] [nvarchar] (50) NULL ,
	[SourcePos_No] [nvarchar] (20) NULL ,
	[TargetWhourseNr] [nvarchar] (20) NULL ,
	[TargetPos_No] [nvarchar] (50) NULL ,
	[Cmemo] [ntext] NULL ,
	[EMEMO] [ntext] NULL ,
	[soprinvseriesnr] [nvarchar] (13) NULL ,
	[soprseriersnr] [nvarchar] (3) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldMaintain] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[projectnr] [nvarchar] (3) NULL ,
	[departnr] [nvarchar] (20) NULL ,
	[P_No] [nvarchar] (20) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[descript] [nvarchar] (60) NULL ,
	[date] [datetime] NULL ,
	[IsClear] [bit] NOT NULL ,
	[Memo] [ntext] NULL ,
	[makedate] [datetime] NULL ,
	[maker] [nvarchar] (7) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldMaintenance] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[SeriesNr] [nvarchar] (3) NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[departnr] [nvarchar] (20) NULL ,
	[receiver] [nvarchar] (10) NULL ,
	[provider] [nvarchar] (10) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[type] [nvarchar] (8) NULL ,
	[state] [nvarchar] (2) NULL ,
	[ChangeName] [nvarchar] (100) NULL ,
	[ChangQty] [int] NULL ,
	[statememo] [ntext] NULL ,
	[modifymemo] [ntext] NULL ,
	[date] [datetime] NULL ,
	[makedate] [datetime] NULL ,
	[maker] [nvarchar] (7) NULL ,
	[OtherFiles] [nvarchar] (100) NULL ,
	[OtherPic] [nvarchar] (100) NULL ,
	[Modifyer] [nvarchar] (20) NULL ,
	[StartModifyDate] [datetime] NULL ,
	[EndModifyDate] [datetime] NULL ,
	[Machine] [nvarchar] (50) NULL ,
	[IsClear] [bit] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldMangleReason] (
	[ZUCode] [nvarchar] (8) NOT NULL ,
	[ZNameC] [nvarchar] (60) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProcessBOM] (
	[invseriesnr] [nvarchar] (15) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[Masternr] [nvarchar] (20) NULL ,
	[Descript] [nvarchar] (40) NULL ,
	[unicost] [money] NULL ,
	[MainUnit] [nvarchar] (10) NULL ,
	[PhysicalQty] [float] NULL ,
	[UpdateDate] [datetime] NULL ,
	[UpdateBy] [nvarchar] (20) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProcessBase] (
	[invseriesnr] [nvarchar] (15) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[StdProdNr] [nvarchar] (20) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[Descript] [nvarchar] (40) NULL ,
	[SMoInvseriesnr] [nvarchar] (13) NULL ,
	[MouldNum] [nvarchar] (13) NULL ,
	[SumQty] [float] NULL ,
	[prodqty] [float] NULL ,
	[badqty] [float] NULL ,
	[finishqty] [float] NULL ,
	[Cost] [float] NULL ,
	[AvgCost] [float] NULL ,
	[make] [nvarchar] (15) NULL ,
	[makeDate] [datetime] NULL ,
	[consignment] [nvarchar] (15) NULL ,
	[signDate] [datetime] NULL ,
	[againsign] [nvarchar] (15) NULL ,
	[againsignDate] [datetime] NULL ,
	[statusno] [nvarchar] (10) NULL ,
	[updateby] [nvarchar] (10) NULL ,
	[updatetime] [datetime] NULL ,
	[cmemo] [ntext] NULL ,
	[ememo] [ntext] NULL ,
	[SchedulePercent] [float] NULL ,
	[stdprodqty] [float] NULL ,
	[TypeNr] [nvarchar] (2) NULL ,
	[ChargeType] [nvarchar] (2) NULL ,
	[ProjectName] [nvarchar] (50) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProcessProduct] (
	[invseriesnr] [nvarchar] (15) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[IDSeriesnr] [nvarchar] (3) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[LevelNr] [smallint] NULL ,
	[LvlSereisNr] [smallint] NULL ,
	[Priority] [float] NULL ,
	[TechnicsNr] [nvarchar] (20) NULL ,
	[TechnicsName] [nvarchar] (40) NULL ,
	[Descript] [nvarchar] (50) NULL ,
	[PriceType] [smallint] NULL ,
	[NextTechnicsNr] [nvarchar] (20) NULL ,
	[NextTechnicsName] [nvarchar] (40) NULL ,
	[NextDescript] [nvarchar] (50) NULL ,
	[Nextseriesnr] [nvarchar] (3) NULL ,
	[StdHour] [float] NOT NULL ,
	[StdPrice] [float] NULL ,
	[TechnicsQty] [float] NULL ,
	[ProcessRate] [float] NULL ,
	[UnitQty] [float] NULL ,
	[Qty] [float] NULL ,
	[IssueQty] [float] NULL ,
	[FinishQty] [float] NULL ,
	[BadQty] [float] NULL ,
	[SpoilQty] [float] NULL ,
	[Dep_No] [nvarchar] (4) NULL ,
	[Dep_Na] [nvarchar] (30) NULL ,
	[IsDepStartTech] [bit] NULL ,
	[IsDepEndTech] [bit] NULL ,
	[WorkCnNr] [nvarchar] (13) NULL ,
	[WorkCnName] [nvarchar] (20) NULL ,
	[PlanStartTime] [datetime] NULL ,
	[PlanFinishTime] [datetime] NULL ,
	[PlanHour] [float] NULL ,
	[InstStartTime] [datetime] NULL ,
	[InstFinishTime] [datetime] NULL ,
	[InstHour] [float] NULL ,
	[Cspecmemo] [ntext] NULL ,
	[Especmemo] [ntext] NULL ,
	[SchedulePercent] [float] NULL ,
	[Cost] [float] NULL ,
	[MakeType] [int] NULL ,
	[UnwontedReason] [nvarchar] (50) NULL ,
	[TransactWay] [nvarchar] (50) NULL ,
	[scheduleInfo1] [nvarchar] (1) NULL ,
	[scheduleInfo2] [nvarchar] (1) NULL ,
	[ProcessID] [nvarchar] (50) NULL ,
	[WorkPiece] [nvarchar] (50) NULL ,
	[tmpseriesnr] [nvarchar] (13) NULL ,
	[WorkDate] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProdBase] (
	[invseriesnr] [nvarchar] (13) NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[InvDate] [datetime] NULL ,
	[Maker] [nvarchar] (20) NULL ,
	[MakeDate] [datetime] NULL ,
	[UnitQty] [int] NULL ,
	[FactUnitQty] [int] NULL ,
	[FactScale] [float] NULL ,
	[Memo] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProdProduct] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[SeriesNr] [nvarchar] (3) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[InvDate] [datetime] NULL ,
	[Maker] [nvarchar] (20) NULL ,
	[MakeDate] [datetime] NULL ,
	[Machine] [nvarchar] (20) NULL ,
	[ProdNr] [nvarchar] (20) NULL ,
	[UnitQty] [int] NULL ,
	[FactUnitQty] [int] NULL ,
	[FactScale] [float] NULL ,
	[ProductNr] [nvarchar] (20) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProduct] (
	[soinvseriesnr] [nvarchar] (13) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[cmemo] [ntext] NULL ,
	[ttlqty] [int] NULL ,
	[receivereason] [nvarchar] (2) NULL ,
	[usedate] [datetime] NULL ,
	[moinvseriesnr] [nvarchar] (20) NULL ,
	[providereason] [nvarchar] (2) NULL ,
	[ReasonName] [nvarchar] (50) NULL ,
	[OtherFiles] [nvarchar] (100) NULL ,
	[OtherPic] [nvarchar] (100) NULL ,
	[Modifyer] [nvarchar] (20) NULL ,
	[StartModifyDate] [datetime] NULL ,
	[EndModifyDate] [datetime] NULL ,
	[FactUnitQty] [int] NULL ,
	[UnitQty] [int] NULL ,
	[ChangeName] [nvarchar] (100) NULL ,
	[ChangQty] [int] NULL ,
	[Machine] [nvarchar] (50) NULL ,
	[ProductNr] [nvarchar] (20) NULL ,
	[productname] [nvarchar] (50) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProductNr] (
	[prodnr] [nvarchar] (20) NOT NULL ,
	[productnr] [nvarchar] (20) NOT NULL ,
	[Descript] [nvarchar] (50) NULL ,
	[Materiler] [nvarchar] (20) NULL ,
	[MaterilDesc] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProvide] (
	[invseriesnr] [nvarchar] (13) NULL ,
	[SeriesNr] [nvarchar] (3) NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[departnr] [nvarchar] (20) NULL ,
	[provider] [nvarchar] (10) NULL ,
	[receiver] [nvarchar] (10) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[providedate] [datetime] NULL ,
	[descript] [nvarchar] (60) NULL ,
	[type] [nvarchar] (8) NULL ,
	[state] [nvarchar] (2) NULL ,
	[providereason] [nvarchar] (2) NULL ,
	[moinvseriesnr] [nvarchar] (20) NULL ,
	[usestartdate] [datetime] NULL ,
	[useenddate] [datetime] NULL ,
	[prepareqty] [int] NULL ,
	[whetherReceive] [bit] NULL ,
	[makedate] [datetime] NULL ,
	[maker] [nvarchar] (10) NULL ,
	[locatenr] [nvarchar] (20) NULL ,
	[TPinvseriesnr] [nvarchar] (13) NULL ,
	[SourceDepartNr] [nvarchar] (20) NULL ,
	[productnr] [nvarchar] (20) NULL ,
	[RepairMemo] [ntext] NULL ,
	[IsCombine] [bit] NULL ,
	[IsNeed] [bit] NULL ,
	[TypeMode] [nvarchar] (10) NULL ,
	[Machine] [nvarchar] (50) NULL ,
	[ISCurrent] [bit] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProvideBase] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[providedate] [datetime] NULL ,
	[departnr] [nvarchar] (20) NULL ,
	[provider] [nvarchar] (10) NULL ,
	[productnr] [nvarchar] (20) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[receiver] [nvarchar] (10) NULL ,
	[providereason] [nvarchar] (2) NULL ,
	[useenddate] [datetime] NULL ,
	[moinvseriesnr] [nvarchar] (20) NULL ,
	[prepareqty] [int] NULL ,
	[SourceDepartNr] [nvarchar] (20) NULL ,
	[locatenr] [nvarchar] (20) NULL ,
	[state] [nvarchar] (2) NULL ,
	[whetherReceive] [bit] NULL ,
	[makedate] [datetime] NULL ,
	[maker] [nvarchar] (10) NULL ,
	[TPinvseriesnr] [nvarchar] (13) NULL ,
	[RepairMemo] [ntext] NULL ,
	[CMemo] [ntext] NULL ,
	[IsCombine] [bit] NULL ,
	[DepartType] [nvarchar] (1) NULL ,
	[descript] [nvarchar] (60) NULL ,
	[type] [nvarchar] (8) NULL ,
	[usestartdate] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProvideProduct] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[SeriesNr] [nvarchar] (3) NOT NULL ,
	[ProdNr] [nvarchar] (20) NULL ,
	[SourceDepartNr] [nvarchar] (20) NULL ,
	[locatenr] [nvarchar] (20) NULL ,
	[State] [nvarchar] (20) NULL ,
	[whetherReceive] [bit] NOT NULL ,
	[TPinvseriesnr] [nvarchar] (13) NULL ,
	[RepairMemo] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldProvideReasonState] (
	[ID] [int] NULL ,
	[REASON] [nvarchar] (10) NULL ,
	[STATE] [nvarchar] (10) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldReceive] (
	[invseriesnr] [nvarchar] (13) NULL ,
	[SeriesNr] [nvarchar] (3) NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[departnr] [nvarchar] (20) NULL ,
	[receiver] [nvarchar] (10) NULL ,
	[provider] [nvarchar] (10) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[descript] [nvarchar] (60) NULL ,
	[type] [nvarchar] (8) NULL ,
	[receivereason] [nvarchar] (2) NULL ,
	[state] [nvarchar] (2) NULL ,
	[moqty] [int] NULL ,
	[motimes] [int] NULL ,
	[statememo] [ntext] NULL ,
	[modifymemo] [ntext] NULL ,
	[receivedate] [datetime] NULL ,
	[soinvseriesnr] [nvarchar] (13) NULL ,
	[soSeriesNr] [nvarchar] (3) NULL ,
	[soinvnr] [nvarchar] (20) NULL ,
	[makedate] [datetime] NULL ,
	[maker] [nvarchar] (10) NULL ,
	[notdepartnr] [nvarchar] (20) NULL ,
	[locatenr] [nvarchar] (20) NULL ,
	[IsFit] [bit] NULL ,
	[IsXin] [bit] NULL ,
	[PushRate] [int] NULL ,
	[parentprodnr] [nvarchar] (30) NULL ,
	[IsCombine] [bit] NULL ,
	[OtherFiles] [nvarchar] (100) NULL ,
	[OtherPic] [nvarchar] (100) NULL ,
	[Modifyer] [nvarchar] (20) NULL ,
	[StartModifyDate] [datetime] NULL ,
	[EndModifyDate] [datetime] NULL ,
	[FactUnitQty] [int] NULL ,
	[Machine] [nvarchar] (50) NULL ,
	[IsProvider] [bit] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldReceiveBase] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (20) NULL ,
	[receivedate] [datetime] NULL ,
	[departnr] [nvarchar] (20) NULL ,
	[soinvseriesnr] [nvarchar] (13) NULL ,
	[soSeriesNr] [nvarchar] (20) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[notdepartnr] [nvarchar] (20) NULL ,
	[locatenr] [nvarchar] (20) NULL ,
	[receiver] [nvarchar] (10) NULL ,
	[receivereason] [nvarchar] (2) NULL ,
	[provider] [nvarchar] (10) NULL ,
	[state] [nvarchar] (2) NULL ,
	[moqty] [int] NULL ,
	[motimes] [int] NULL ,
	[statememo] [ntext] NULL ,
	[modifymemo] [ntext] NULL ,
	[maker] [nvarchar] (10) NULL ,
	[makedate] [datetime] NULL ,
	[IsCombine] [bit] NULL ,
	[DepartType] [nvarchar] (1) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldReceiveMangle] (
	[InvSeriesNr] [nvarchar] (13) NULL ,
	[SeriesNr] [nvarchar] (3) NULL ,
	[Manglereason] [nvarchar] (8) NULL ,
	[CMemo] [nvarchar] (2000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldReceiveProduct] (
	[invseriesnr] [nvarchar] (13) NULL ,
	[SeriesNr] [nvarchar] (3) NULL ,
	[soinvseriesnr] [nvarchar] (13) NULL ,
	[soSeriesNr] [nvarchar] (3) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[notdepartnr] [nvarchar] (20) NULL ,
	[locatenr] [nvarchar] (20) NULL ,
	[state] [nvarchar] (2) NULL ,
	[moqty] [int] NULL ,
	[motimes] [int] NULL ,
	[IsFit] [bit] NOT NULL ,
	[statememo] [ntext] NULL ,
	[modifymemo] [ntext] NULL ,
	[IsXin] [bit] NOT NULL ,
	[PushRate] [int] NULL ,
	[parentprodnr] [nvarchar] (30) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldReceiveRepair] (
	[InvSeriesNr] [nvarchar] (13) NULL ,
	[SeriesNr] [nvarchar] (3) NULL ,
	[Repairitem] [nvarchar] (8) NULL ,
	[CMemo] [nvarchar] (2000) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldRegular] (
	[ProdNr] [nvarchar] (20) NOT NULL ,
	[SeriesNr] [nvarchar] (3) NOT NULL ,
	[Repairitem] [nvarchar] (8) NULL ,
	[RepairName] [nvarchar] (50) NULL ,
	[PrevDate] [datetime] NULL ,
	[Days] [int] NULL ,
	[NextDate] [datetime] NULL ,
	[Times] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldRepairItem] (
	[ZUCode] [nvarchar] (8) NOT NULL ,
	[ZNameC] [nvarchar] (60) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldStdProcessBase] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[Descript] [nvarchar] (40) NULL ,
	[MouldNum] [nvarchar] (13) NULL ,
	[SumQty] [float] NULL ,
	[Cost] [float] NULL ,
	[AvgCost] [float] NULL ,
	[make] [nvarchar] (15) NULL ,
	[makeDate] [datetime] NULL ,
	[consignment] [nvarchar] (15) NULL ,
	[signDate] [datetime] NULL ,
	[againsign] [nvarchar] (15) NULL ,
	[againsignDate] [datetime] NULL ,
	[statusno] [nvarchar] (10) NULL ,
	[updateby] [nvarchar] (10) NULL ,
	[updatetime] [datetime] NULL ,
	[cmemo] [ntext] NULL ,
	[ememo] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldStdProcessProduct] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[prodnr] [nvarchar] (20) NOT NULL ,
	[LevelNr] [smallint] NULL ,
	[LvlSereisNr] [smallint] NULL ,
	[TechnicsNr] [nvarchar] (20) NULL ,
	[TechnicsName] [nvarchar] (40) NULL ,
	[Descript] [nvarchar] (50) NULL ,
	[NextTechnicsNr] [nvarchar] (20) NULL ,
	[NextTechnicsName] [nvarchar] (40) NULL ,
	[NextDescript] [nvarchar] (50) NULL ,
	[Nextseriesnr] [nvarchar] (3) NULL ,
	[Dep_No] [nvarchar] (4) NULL ,
	[Dep_Na] [nvarchar] (30) NULL ,
	[IsDepStartTech] [bit] NULL ,
	[IsDepEndTech] [bit] NULL ,
	[StdHour] [float] NOT NULL ,
	[StdPrice] [float] NOT NULL ,
	[ProcessRate] [float] NULL ,
	[UnitQty] [float] NULL ,
	[WorkCnNr] [nvarchar] (13) NULL ,
	[WorkCnName] [nvarchar] (20) NULL ,
	[Cspecmemo] [ntext] NULL ,
	[Especmemo] [ntext] NULL ,
	[ProcessID] [nvarchar] (50) NULL ,
	[tmpseriesnr] [nvarchar] (3) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldTechnics] (
	[TechnicsNr] [nvarchar] (20) NULL ,
	[TechnicsName] [nvarchar] (40) NULL ,
	[Descript] [nvarchar] (50) NULL ,
	[Price] [float] NULL ,
	[WorkHr] [float] NULL ,
	[HardLevel] [float] NULL ,
	[PriceType] [smallint] NULL ,
	[Cspecmemo] [ntext] NULL ,
	[Especmemo] [ntext] NULL ,
	[updateby] [nvarchar] (15) NULL ,
	[updatetime] [datetime] NULL ,
	[ProcType] [nvarchar] (10) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldType] (
	[ZUCODE] [nvarchar] (8) NULL ,
	[ZNAMEC] [nvarchar] (60) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[MouldVindicate] (
	[prodnr] [nvarchar] (20) NULL ,
	[projectNr] [nvarchar] (3) NULL ,
	[ProjectName] [nvarchar] (50) NULL ,
	[ProjectMemo] [ntext] NULL ,
	[weihuqty] [int] NULL ,
	[punchqty] [int] NULL ,
	[weihuttl] [int] NULL ,
	[safeqty] [int] NULL ,
	[SeriesNr] [nvarchar] (3) NULL ,
	[OldPunchQty] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[ObjectMethod] (
	[Object_Id] [int] NOT NULL ,
	[Method_Id] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Objects] (
	[Object_Id] [int] NOT NULL ,
	[Object_Code] [nvarchar] (50) NULL ,
	[Object_Name_P] [nvarchar] (50) NULL ,
	[Object_Name] [nvarchar] (50) NULL ,
	[Object_Order] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ObjectsLicense] (
	[OBJECT_ID] [int] NULL ,
	[MODEL_ACTION_NAME] [varchar] (20) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OperLog] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[OperKey] [varchar] (30) NULL ,
	[OperObject] [varchar] (50) NULL ,
	[OperMethod] [varchar] (30) NULL ,
	[OperName] [varchar] (20) NULL ,
	[OperPcName] [varchar] (20) NULL ,
	[OperDate] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[PackBase_Quote] (
	[PackNo] [nvarchar] (10) NULL ,
	[PackName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Qty] [int] NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[PackCost_Quote] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[MaterialNo] [nvarchar] (20) NOT NULL ,
	[ProdName] [nvarchar] (50) NULL ,
	[RowID] [int] NOT NULL ,
	[QuoteNo] [nvarchar] (20) NULL ,
	[PackNo] [nvarchar] (10) NULL ,
	[PackName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Qty] [int] NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL ,
	[Cost] [money] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[PaperBase] (
	[invseriesnr] [nvarchar] (20) NULL ,
	[PaperNr] [nvarchar] (20) NULL ,
	[TypeNr] [nvarchar] (15) NULL ,
	[ProdCls] [nvarchar] (4) NULL ,
	[ProdType] [nvarchar] (50) NULL ,
	[Version] [nvarchar] (10) NULL ,
	[FileVersion] [nvarchar] (4) NULL ,
	[Class] [nvarchar] (4) NULL ,
	[Prodnr] [nvarchar] (20) NULL ,
	[Descript] [nvarchar] (40) NULL ,
	[StatusNo] [bit] NOT NULL ,
	[InvalidDate] [smalldatetime] NULL ,
	[PublishDate] [smalldatetime] NULL ,
	[Draw] [nvarchar] (15) NULL ,
	[consignment] [nvarchar] (15) NULL ,
	[signDate] [datetime] NULL ,
	[againsign] [nvarchar] (15) NULL ,
	[againsignDate] [datetime] NULL ,
	[Location] [nvarchar] (20) NULL ,
	[PaperSrc] [nvarchar] (1) NULL ,
	[customernr] [nvarchar] (20) NULL ,
	[providernr] [nvarchar] (20) NULL ,
	[PicPath] [nvarchar] (250) NULL ,
	[ModifyMemo] [ntext] NULL ,
	[Memo] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[PaperClass] (
	[TypeNr] [nvarchar] (20) NULL ,
	[TypeName] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ProductClass] (
	[prodclass] [varchar] (50) NOT NULL ,
	[PClassName] [varchar] (50) NULL ,
	[updatetime] [datetime] NULL ,
	[updateby] [varchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ProviderBase] (
	[providernr] [varchar] (20) NOT NULL ,
	[providername] [varchar] (40) NULL ,
	[providerbrief] [varchar] (20) NULL ,
	[address1] [varchar] (50) NULL ,
	[address2] [varchar] (50) NULL ,
	[address3] [varchar] (50) NULL ,
	[enprovidername] [varchar] (50) NULL ,
	[enproviderbrief] [varchar] (20) NULL ,
	[enaddress1] [varchar] (50) NULL ,
	[enaddress2] [varchar] (50) NULL ,
	[enaddress3] [varchar] (50) NULL ,
	[currency_id] [varchar] (10) NULL ,
	[gstnr] [varchar] (12) NULL ,
	[ISO1] [varchar] (20) NULL ,
	[ISO2] [varchar] (20) NULL ,
	[fax] [varchar] (20) NULL ,
	[tel] [varchar] (20) NULL ,
	[email] [varchar] (50) NULL ,
	[homepage] [varchar] (50) NULL ,
	[sale_nr] [varchar] (50) NULL ,
	[updatetime] [datetime] NULL ,
	[updateby] [varchar] (10) NULL ,
	[attachmemo] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Quote] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[QuoteNo] [nvarchar] (15) NULL ,
	[IVDate] [smalldatetime] NULL ,
	[QuoteDate] [smalldatetime] NULL ,
	[ProjectNo] [nvarchar] (50) NULL ,
	[ProdNo] [nvarchar] (20) NULL ,
	[ProdName] [nvarchar] (50) NULL ,
	[Ver] [nvarchar] (20) NULL ,
	[CustomerNr] [nvarchar] (20) NULL ,
	[ProdCls] [nvarchar] (20) NULL ,
	[Memo] [ntext] NULL ,
	[Wasting] [float] NULL ,
	[ItemNo] [nvarchar] (20) NULL ,
	[ItemName] [nvarchar] (50) NULL ,
	[NetWeight] [float] NULL ,
	[Weight] [float] NULL ,
	[NetCost] [float] NULL ,
	[Face] [float] NULL ,
	[Technics] [float] NULL ,
	[TechnicsCost] [float] NULL ,
	[TechnicsHandress] [float] NULL ,
	[Pack] [float] NULL ,
	[Freight] [float] NULL ,
	[Tax] [float] NULL ,
	[Mould] [float] NULL ,
	[MouldCost] [float] NULL ,
	[MouldQty] [float] NULL ,
	[MouldFixCost] [float] NULL ,
	[Manage] [float] NULL ,
	[ManageRate] [float] NULL ,
	[ManageFixCost] [float] NULL ,
	[Gain] [float] NULL ,
	[TotalCost] [float] NULL ,
	[GainRate] [float] NULL ,
	[GainFix] [float] NULL ,
	[CalcPrice] [float] NULL ,
	[AdjustPrice] [float] NULL ,
	[LastPrice] [float] NULL ,
	[LastGain] [float] NULL ,
	[LastGainRate] [float] NULL ,
	[Upd_By] [nvarchar] (20) NULL ,
	[Update_Date] [datetime] NULL ,
	[make] [nvarchar] (15) NOT NULL ,
	[makeDate] [smalldatetime] NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[RPTTEMPLATE] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[RPTNAME] [varchar] (100) NULL ,
	[RPTOBJ] [image] NULL ,
	[RPTTYPE] [varchar] (10) NULL ,
	[CreateDate] [datetime] NULL ,
	[CreateUser] [varchar] (20) NULL ,
	[UpdateDate] [datetime] NULL ,
	[UpdateUser] [varchar] (20) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[SysDefaultSet] (
	[key] [int] NOT NULL ,
	[Sys_Key] [varchar] (200) NOT NULL ,
	[Disk_No] [varchar] (200) NOT NULL ,
	[dog_key] [varchar] (200) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[System_Trace] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[UpdateTime] [datetime] NULL ,
	[User_Code] [nvarchar] (20) NULL ,
	[User_Name] [nvarchar] (30) NULL ,
	[Computer_Name] [nvarchar] (50) NULL ,
	[Object_ID] [int] NULL ,
	[Object_Name] [nvarchar] (50) NULL ,
	[Method_ID] [int] NULL ,
	[Method_Name] [nvarchar] (50) NULL ,
	[Memo] [nvarchar] (250) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TaxBase_Quote] (
	[TaxNo] [nvarchar] (10) NULL ,
	[TaxName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Qty] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TaxCost_Quote] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[MaterialNo] [nvarchar] (20) NOT NULL ,
	[ProdName] [nvarchar] (50) NULL ,
	[RowID] [int] NOT NULL ,
	[QuoteNo] [nvarchar] (50) NULL ,
	[TaxNo] [nvarchar] (10) NULL ,
	[TaxName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Qty] [int] NULL ,
	[Cost] [money] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TechnicsBase] (
	[TechnicsNr] [nvarchar] (20) NULL ,
	[TechnicsName] [nvarchar] (40) NULL ,
	[Descript] [nvarchar] (50) NULL ,
	[Price] [float] NULL ,
	[WorkHr] [float] NULL ,
	[HardLevel] [float] NULL ,
	[PriceType] [smallint] NULL ,
	[Cspecmemo] [ntext] NULL ,
	[Especmemo] [ntext] NULL ,
	[updateby] [nvarchar] (15) NULL ,
	[updatetime] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TechnicsBase_Quote] (
	[TechnicsNo] [nvarchar] (10) NULL ,
	[TechnicsName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Unit] [nvarchar] (20) NULL ,
	[Qty] [int] NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TechnicsCost_Quote] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[seriesnr] [nvarchar] (3) NOT NULL ,
	[OrderNo] [int] NULL ,
	[MaterialNo] [nvarchar] (20) NOT NULL ,
	[ProdName] [nvarchar] (50) NULL ,
	[RowID] [int] NOT NULL ,
	[QuoteNo] [nvarchar] (20) NULL ,
	[TechnicsNo] [nvarchar] (10) NULL ,
	[TechnicsName] [nvarchar] (50) NULL ,
	[Price] [money] NULL ,
	[Unit] [nvarchar] (20) NULL ,
	[Qty] [int] NULL ,
	[Providernr] [nvarchar] (20) NULL ,
	[providername] [nvarchar] (40) NULL ,
	[Cost] [money] NULL ,
	[Wasting] [float] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TechnicsMaster] (
	[TechnicsNr] [nvarchar] (20) NULL ,
	[Prodnr] [nvarchar] (20) NOT NULL ,
	[Cspecmemo] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TempPrivilege] (
	[Group_User_Id] [int] NULL ,
	[Object_Id] [int] NULL ,
	[Method_Id1] [int] NULL ,
	[Method_Id2] [int] NULL ,
	[Method_Id3] [int] NULL ,
	[Method_Id4] [int] NULL ,
	[Method_Id5] [int] NULL ,
	[Method_Id6] [int] NULL ,
	[Method_Id7] [int] NULL ,
	[Method_Id8] [int] NULL ,
	[Method_Id9] [int] NULL ,
	[Method_Id10] [int] NULL ,
	[Method_Id11] [int] NULL ,
	[Method_Id12] [int] NULL ,
	[Method_Id13] [int] NULL ,
	[Method_Id14] [int] NULL ,
	[Method_Id15] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TmpTable] (
	[KeyNr] [nvarchar] (1) NULL ,
	[IsSelect] [bit] NOT NULL ,
	[CQty1] [float] NULL ,
	[CQty2] [float] NULL ,
	[CStr1] [nvarchar] (50) NULL ,
	[CStr2] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[UserPrivilege] (
	[User_Id] [int] NULL ,
	[Object_Id] [int] NULL ,
	[Method_Id] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Users] (
	[User_Id] [int] IDENTITY (1, 1) NOT NULL ,
	[User_Code] [varchar] (50) NULL ,
	[User_Name] [varchar] (50) NOT NULL ,
	[User_Ps] [varchar] (50) NULL ,
	[Stoped] [smallint] NULL ,
	[SaleMan] [varchar] (50) NULL ,
	[Modify_User_Id] [int] NULL ,
	[Modify_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Version] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[Version] [varchar] (10) NULL ,
	[Updatetime] [datetime] NULL ,
	[ExeFile] [image] NULL ,
	[ChsFile] [image] NULL ,
	[ChtFile] [image] NULL ,
	[UpdateExeFile] [image] NULL ,
	[UpdateChsFile] [image] NULL ,
	[UpdateChtFile] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[WorkCenter] (
	[WorkCnNr] [nvarchar] (13) NOT NULL ,
	[WorkCnName] [nvarchar] (20) NULL ,
	[MachinNum] [int] NULL ,
	[PersonNum] [int] NULL ,
	[Cmemo] [ntext] NULL ,
	[EMEMO] [ntext] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[WorkCenterPn] (
	[WorkCnNr] [nvarchar] (13) NOT NULL ,
	[PersonNr] [nvarchar] (10) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[mouldscheduledetail] (
	[invseriesnr] [nvarchar] (13) NULL ,
	[seriesnr] [nvarchar] (3) NULL ,
	[TechnicsNr] [nvarchar] (20) NULL ,
	[TechnicsName] [nvarchar] (40) NULL ,
	[schedulepercent] [float] NULL ,
	[scheduleInfo1] [nvarchar] (1) NULL ,
	[scheduleInfo2] [nvarchar] (1) NULL ,
	[PlanStartTime] [datetime] NULL ,
	[PlanFinishTime] [datetime] NULL ,
	[PlanDays] [int] NULL ,
	[InstFinishTime] [datetime] NULL ,
	[cmemo] [ntext] NULL ,
	[InstStartTime] [datetime] NULL ,
	[InstDays] [float] NULL ,
	[UnwontedReason] [nvarchar] (50) NULL ,
	[TransactWay] [nvarchar] (50) NULL ,
	[WorkCnNr] [nvarchar] (13) NULL ,
	[soProcessID] [nvarchar] (50) NULL ,
	[processInvseriesnr] [nvarchar] (13) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mouldscheduledetailnew] (
	[invseriesnr] [nvarchar] (13) NULL ,
	[seriesnr] [nvarchar] (3) NULL ,
	[TechnicsNr] [nvarchar] (20) NULL ,
	[TechnicsName] [nvarchar] (40) NULL ,
	[schedulepercent] [float] NULL ,
	[scheduleInfo1] [nvarchar] (1) NULL ,
	[scheduleInfo2] [nvarchar] (1) NULL ,
	[PlanStartTime] [datetime] NULL ,
	[PlanFinishTime] [datetime] NULL ,
	[PlanDays] [int] NULL ,
	[InstFinishTime] [datetime] NULL ,
	[cmemo] [ntext] NULL ,
	[InstStartTime] [datetime] NULL ,
	[InstDays] [float] NULL ,
	[UnwontedReason] [nvarchar] (50) NULL ,
	[TransactWay] [nvarchar] (50) NULL ,
	[processInvseriesnr] [nvarchar] (13) NULL ,
	[schedulepercentM] [float] NULL ,
	[TechnicsDescript] [nvarchar] (50) NULL ,
	[soProcessID] [nvarchar] (50) NULL ,
	[WorkCnNr] [nvarchar] (20) NULL ,
	[WorkDate] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mouldschedulemaster] (
	[invseriesnr] [nvarchar] (13) NULL ,
	[invnr] [nvarchar] (13) NULL ,
	[prodnr] [nvarchar] (20) NULL ,
	[schedulepercent] [float] NULL ,
	[maker] [nvarchar] (8) NULL ,
	[makedate] [datetime] NULL ,
	[updateby] [nvarchar] (8) NULL ,
	[updatetime] [datetime] NULL ,
	[cmemo] [ntext] NULL ,
	[processInvseriesnr] [nvarchar] (13) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mouldschedulemasternew] (
	[invseriesnr] [nvarchar] (13) NOT NULL ,
	[invnr] [nvarchar] (13) NULL ,
	[workcenternr] [nvarchar] (20) NULL ,
	[maker] [nvarchar] (8) NULL ,
	[makedate] [datetime] NULL ,
	[updateby] [nvarchar] (8) NULL ,
	[updatetime] [datetime] NULL ,
	[cmemo] [ntext] NULL ,
	[isworkcenter] [bit] NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[BomBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_BomBase] PRIMARY KEY  CLUSTERED 
	(
		[prodnr],
		[Version]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Currency] WITH NOCHECK ADD 
	CONSTRAINT [PK_Currency] PRIMARY KEY  CLUSTERED 
	(
		[RowID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[CustomerBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_CustomerBase] PRIMARY KEY  CLUSTERED 
	(
		[customernr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Depart] WITH NOCHECK ADD 
	CONSTRAINT [PK_Depart] PRIMARY KEY  CLUSTERED 
	(
		[Dep_No]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[DepartDetail] WITH NOCHECK ADD 
	CONSTRAINT [PK_DepartDetail] PRIMARY KEY  CLUSTERED 
	(
		[Dep_No],
		[Pos_No]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[EmpPerson] WITH NOCHECK ADD 
	CONSTRAINT [PK_EmpPerson] PRIMARY KEY  CLUSTERED 
	(
		[P_no]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Groups] WITH NOCHECK ADD 
	CONSTRAINT [PK_Groups] PRIMARY KEY  CLUSTERED 
	(
		[Group_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[InventoryBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_InventoryBase] PRIMARY KEY  CLUSTERED 
	(
		[prodnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Methods] WITH NOCHECK ADD 
	CONSTRAINT [PK_Methods] PRIMARY KEY  CLUSTERED 
	(
		[Method_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldBase] PRIMARY KEY  CLUSTERED 
	(
		[prodnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldBaseCurrent] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldBaseCurrent] PRIMARY KEY  CLUSTERED 
	(
		[prodnr],
		[CurrentProdNr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldBaseUse] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldBaseUse] PRIMARY KEY  CLUSTERED 
	(
		[prodnr],
		[Useprodnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldChgStatusBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldChgStatusBase] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldChgStatusProduct] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldChgStatusProduct] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr],
		[seriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldCostBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldCostBase] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldCostProduct] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldCostProduct] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldInOutBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldInOutBase] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldInOutProduct] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldInOutProduct] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr],
		[seriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldMaintain] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldMaintain] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldMaintenance] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldMaintenance] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldMangleReason] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldMangleReason] PRIMARY KEY  CLUSTERED 
	(
		[ZUCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldProcessBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldProcessBase] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldProcessProduct] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldProcessProduct] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr],
		[seriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldProdProduct] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldProdProduct] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr],
		[SeriesNr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldProductNr] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldProductNr] PRIMARY KEY  CLUSTERED 
	(
		[prodnr],
		[productnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldProvideBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldProvideBase] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldProvideProduct] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldProvideProduct] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr],
		[SeriesNr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldReceiveBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldReceiveBase] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldRepairItem] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldRepairItem] PRIMARY KEY  CLUSTERED 
	(
		[ZUCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldStdProcessBase] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldStdProcessBase] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldStdProcessProduct] WITH NOCHECK ADD 
	CONSTRAINT [PK_MouldStdProcessProduct] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr],
		[seriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ObjectMethod] WITH NOCHECK ADD 
	CONSTRAINT [PK_ObjectMethod] PRIMARY KEY  CLUSTERED 
	(
		[Object_Id],
		[Method_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Objects] WITH NOCHECK ADD 
	CONSTRAINT [PK_Objects] PRIMARY KEY  CLUSTERED 
	(
		[Object_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[OperLog] WITH NOCHECK ADD 
	CONSTRAINT [PK_OperLog] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[RPTTEMPLATE] WITH NOCHECK ADD 
	CONSTRAINT [PK_RPTTEMPLATE] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[System_Trace] WITH NOCHECK ADD 
	CONSTRAINT [PK_System_Trace] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Users] WITH NOCHECK ADD 
	CONSTRAINT [PK_Users] PRIMARY KEY  CLUSTERED 
	(
		[User_Id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Version] WITH NOCHECK ADD 
	CONSTRAINT [PK_Version] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[WorkCenter] WITH NOCHECK ADD 
	CONSTRAINT [PK_WorkCenter] PRIMARY KEY  CLUSTERED 
	(
		[WorkCnNr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[mouldschedulemasternew] WITH NOCHECK ADD 
	CONSTRAINT [PK_mouldschedulemasternew] PRIMARY KEY  CLUSTERED 
	(
		[invseriesnr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[CompanyInfo] ADD 
	CONSTRAINT [DF_CompanyInfo_CtrlMaterial] DEFAULT (0) FOR [CtrlMaterial],
	CONSTRAINT [DF__CompanyIn__OverC__4B7734FF] DEFAULT (0) FOR [OverConfirm],
	CONSTRAINT [DF__CompanyIn__Provi__4C6B5938] DEFAULT (0) FOR [ProvideControl],
	CONSTRAINT [DF__CompanyIn__CtrlM__4D5F7D71] DEFAULT (0) FOR [CtrlMouldStatus],
	CONSTRAINT [DF__CompanyIn__CtrlM__4E53A1AA] DEFAULT (0) FOR [CtrlMouldStore],
	CONSTRAINT [DF_CompanyInfo_PrintType] DEFAULT ('print') FOR [PrintType]
GO

ALTER TABLE [dbo].[DotInfo] ADD 
	CONSTRAINT [DF_DotInfo_QtyDot] DEFAULT (2) FOR [QtyDot],
	CONSTRAINT [DF_DotInfo_LpriceDot] DEFAULT (2) FOR [LpriceDot],
	CONSTRAINT [DF_DotInfo_FpriceDot] DEFAULT (2) FOR [FpriceDot],
	CONSTRAINT [DF_DotInfo_LAmountDot] DEFAULT (2) FOR [LAmountDot],
	CONSTRAINT [DF_DotInfo_FAmountDot] DEFAULT (2) FOR [FAmountDot],
	CONSTRAINT [DF_DotInfo_TaxDot] DEFAULT (2) FOR [TaxDot],
	CONSTRAINT [DF_DotInfo_LTaxAmountDot] DEFAULT (2) FOR [LTaxAmountDot],
	CONSTRAINT [DF_DotInfo_LCostDot] DEFAULT (2) FOR [LCostDot],
	CONSTRAINT [DF_DotInfo_FCostDot] DEFAULT (2) FOR [FCostDot],
	CONSTRAINT [DF_DotInfo_DiscountDot] DEFAULT (2) FOR [DiscountDot],
	CONSTRAINT [DF_DotInfo_ExchangeDot] DEFAULT (2) FOR [ExchangeDot],
	CONSTRAINT [DF_DotInfo_BomRateQtyDot] DEFAULT (2) FOR [BomRateQtyDot],
	CONSTRAINT [DF_DotInfo_BomQtyDot] DEFAULT (2) FOR [BomQtyDot],
	CONSTRAINT [DF_DotInfo_WorkTimeDot] DEFAULT (2) FOR [WorkTimeDot]
GO

ALTER TABLE [dbo].[InventoryBase] ADD 
	CONSTRAINT [DF_InventoryBase_uniprice] DEFAULT (0) FOR [uniprice],
	CONSTRAINT [DF_InventoryBase_Alocation] DEFAULT (0) FOR [Alocation]
GO

ALTER TABLE [dbo].[MouldBase] ADD 
	CONSTRAINT [DF_MouldBase_ttlqty] DEFAULT (0) FOR [ttlqty],
	CONSTRAINT [DF_MouldBase_ttltimes] DEFAULT (0) FOR [ttltimes],
	CONSTRAINT [DF_MouldBase_inittimes] DEFAULT (0) FOR [inittimes],
	CONSTRAINT [DF_MouldBase_relativeqty] DEFAULT (1) FOR [relativeqty],
	CONSTRAINT [DF_MouldBase_ttlage] DEFAULT (0) FOR [ttlage],
	CONSTRAINT [DF_MouldBase_weihuqty] DEFAULT (0) FOR [weihuqty],
	CONSTRAINT [DF_MouldBase_weihuttl] DEFAULT (0) FOR [weihuttl],
	CONSTRAINT [DF_MouldBase_IsBack] DEFAULT (0) FOR [IsBack],
	CONSTRAINT [DF_MouldBase_safeage] DEFAULT (0) FOR [safeage]
GO

ALTER TABLE [dbo].[MouldMaintenance] ADD 
	CONSTRAINT [DF_MouldMaintenance_IsClear] DEFAULT (0) FOR [IsClear]
GO

ALTER TABLE [dbo].[MouldProcessBase] ADD 
	CONSTRAINT [DF_MouldProcessBase_SchedulePercent] DEFAULT (0) FOR [SchedulePercent]
GO

ALTER TABLE [dbo].[MouldProcessProduct] ADD 
	CONSTRAINT [DF_MouldProcessProduct_StdHour] DEFAULT (0) FOR [StdHour],
	CONSTRAINT [DF_MouldProcessProduct_StdPrice] DEFAULT (0) FOR [StdPrice],
	CONSTRAINT [DF_MouldProcessProduct_IsDepStartTech] DEFAULT (0) FOR [IsDepStartTech],
	CONSTRAINT [DF_MouldProcessProduct_IsDepEndTech] DEFAULT (0) FOR [IsDepEndTech],
	CONSTRAINT [DF_MouldProcessProduct_PlanHour] DEFAULT (0) FOR [PlanHour],
	CONSTRAINT [DF_MouldProcessProduct_InstHour] DEFAULT (0) FOR [InstHour],
	CONSTRAINT [DF_MouldProcessProduct_SchedulePercent] DEFAULT (0) FOR [SchedulePercent],
	CONSTRAINT [DF_MouldProcessProduct_Cost] DEFAULT (0) FOR [Cost],
	CONSTRAINT [DF_MouldProcessProduct_WorkPiece] DEFAULT (' ') FOR [WorkPiece]
GO

ALTER TABLE [dbo].[MouldProvide] ADD 
	CONSTRAINT [DF_MouldProvide_whetherReceive] DEFAULT (0) FOR [whetherReceive],
	CONSTRAINT [DF_MouldProvide_IsCombine] DEFAULT (0) FOR [IsCombine],
	CONSTRAINT [DF_MouldProvide_IsNeed] DEFAULT (0) FOR [IsNeed],
	CONSTRAINT [DF__MouldProv__ISCur__793DFFAF] DEFAULT (0) FOR [ISCurrent],
	CONSTRAINT [IX_MouldProvide] UNIQUE  NONCLUSTERED 
	(
		[invseriesnr],
		[SeriesNr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldProvideBase] ADD 
	CONSTRAINT [DF_MouldProvideBase_whetherReceive] DEFAULT (0) FOR [whetherReceive],
	CONSTRAINT [DF_MouldProvideBase_IsCombine] DEFAULT (0) FOR [IsCombine]
GO

ALTER TABLE [dbo].[MouldReceive] ADD 
	CONSTRAINT [DF_MouldReceive_IsFit] DEFAULT (0) FOR [IsFit],
	CONSTRAINT [DF_MouldReceive_IsXin] DEFAULT (0) FOR [IsXin],
	CONSTRAINT [DF_MouldReceive_IsCombine] DEFAULT (0) FOR [IsCombine],
	CONSTRAINT [DF_MouldReceive_IsProvider] DEFAULT (0) FOR [IsProvider],
	CONSTRAINT [IX_MouldReceive] UNIQUE  NONCLUSTERED 
	(
		[invseriesnr],
		[SeriesNr]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[MouldReceiveBase] ADD 
	CONSTRAINT [DF_MouldReceiveBase_IsCombine] DEFAULT (0) FOR [IsCombine]
GO

ALTER TABLE [dbo].[MouldStdProcessProduct] ADD 
	CONSTRAINT [DF__MouldStdP__Proce__531856C7] DEFAULT (newid()) FOR [ProcessID]
GO

ALTER TABLE [dbo].[WorkCenterPn] ADD 
	CONSTRAINT [IX_WorkCenterPn] UNIQUE  NONCLUSTERED 
	(
		[WorkCnNr],
		[PersonNr]
	)  ON [PRIMARY] 
GO

