create database wtu go use wtu go --档案传递信息表 create table dbo.transtime ( entitytype nvarchar(60) not null, --档案类型 lasttime datetime --最后传递时间 ) go --错误信息表 create table dbo.errmsg ( sysid int identity(1,1), operdate datetime default(getdate()), opertype nvarchar(60) not null, msg nvarchar(4000), sources nvarchar(400), errorflag int default(0) --0,从中间库到业务系统,1,从业务系统到中间库 ) go --旺店通日志表 create table dbo.wdtlogs ( sysid int identity(1,1), operdate datetime default(getdate()), opertype nvarchar(60) not null, args nvarchar(4000) null, returncode nvarchar(10) null, msg nvarchar(400) null ) --存货 CREATE TABLE dbo.Inventory( sysid int identity(1,1), cInvCode nvarchar(60) NOT NULL, cInvName nvarchar(255) NULL, cInvStd nvarchar(255) NULL, bPurchase bit NOT NULL, iTaxRate float NULL, importdate datetime null default(getdate()), processdate datetime null, cComUnitCode nvarchar(35) null, processflag bit default(0) ) GO --库存期初 create table dbo.stock( sysid int identity(1,1), cInvCode nvarchar(60) NOT NULL, cwhcode nvarchar(30) not null, qty decimal(26,4) not null default(0), price decimal(13,4) not null default(0), importdate datetime null default(getdate()), processflag int default(0) ) go --仓库 CREATE TABLE dbo.Warehouse( sysid int identity(1,1), cWhCode nvarchar(10) NOT NULL, cWhName nvarchar(20) NULL, importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0) ) --供应商 CREATE TABLE dbo.Vendor( sysid int identity(1,1), cVenCode nvarchar(20) NOT NULL, cVenName nvarchar(98) NULL, cVenPhone nvarchar(100) null, cVenAbbName nvarchar(60) NOT NULL, cVenPerson [nvarchar](50) NULL, importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0) ) GO --其他入库单 CREATE TABLE [dbo].[RdRecord08]( sysid int identity(1,1), [ID] [bigint] NOT NULL, [bRdFlag] [tinyint] NOT NULL, [cVouchType] [nvarchar](2) NOT NULL, [cBusType] [nvarchar](12) NULL, [cSource] [nvarchar](50) NOT NULL, [cBusCode] [nvarchar](30) NULL, [cWhCode] [nvarchar](10) NOT NULL, [dDate] [datetime] NOT NULL, [cCode] [nvarchar](30) NOT NULL, [cRdCode] [nvarchar](5) NULL, [cDepCode] [nvarchar](12) NULL, [cPersonCode] [nvarchar](20) NULL, [cPTCode] [nvarchar](2) NULL, [cSTCode] [nvarchar](2) NULL, [cCusCode] [nvarchar](20) NULL, [cVenCode] [nvarchar](20) NULL, [cOrderCode] [nvarchar](30) NULL, [cARVCode] [nvarchar](30) NULL, [cBillCode] [bigint] NULL, [cDLCode] [bigint] NULL, [cProBatch] [nvarchar](60) NULL, [cHandler] [nvarchar](20) NULL, [cMemo] [nvarchar](255) NULL, [bTransFlag] [bit] NOT NULL, [cAccounter] [nvarchar](20) NULL, [cMaker] [nvarchar](20) NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [dKeepDate] [nvarchar](5) NULL, [dVeriDate] [datetime] NULL, [bpufirst] [bit] NULL, [biafirst] [bit] NULL, [iMQuantity] [float] NULL, [dARVDate] [datetime] NULL, [cChkCode] [nvarchar](30) NULL, [dChkDate] [datetime] NULL, [cChkPerson] [nvarchar](40) NULL, [VT_ID] [int] NULL, [bIsSTQc] [bit] NOT NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [gspcheck] [nvarchar](10) NULL, [ufts] [timestamp] NULL, [iExchRate] [float] NULL, [cExch_Name] [nvarchar](8) NULL, [bOMFirst] [bit] NULL, [bFromPreYear] [bit] NULL, [bIsLsQuery] [bit] NULL, [bIsComplement] [smallint] NULL, [iDiscountTaxType] [tinyint] NULL, [ireturncount] [int] NULL, [iverifystate] [int] NULL, [iswfcontrolled] [int] NULL, [cModifyPerson] [nvarchar](50) NULL, [dModifyDate] [datetime] NULL, [dnmaketime] [datetime] NULL, [dnmodifytime] [datetime] NULL, [dnverifytime] [datetime] NULL, [bredvouch] [int] NULL, [iFlowId] [int] NULL, [cPZID] [nvarchar](30) NULL, [cSourceLs] [nvarchar](4) NULL, [cSourceCodeLs] [nvarchar](20) NULL, [iPrintCount] [int] NULL, [ctransflag] [nvarchar](2) NULL, [csysbarcode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [cCheckSignFlag] [nvarchar](36) NULL, importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0) --0:从U8到中间库,1:从旺店通到中间库 ) CREATE TABLE [dbo].[rdrecords08]( sysid int identity(1,1), [AutoID] [bigint] NOT NULL, [ID] [bigint] NOT NULL, [cInvCode] [nvarchar](60) NOT NULL, [iNum] [decimal](30, 10) NULL, [iQuantity] [decimal](30, 10) NULL, [iUnitCost] [decimal](30, 10) NULL, [iPrice] [money] NULL, [iAPrice] [money] NULL, [iPUnitCost] [decimal](30, 10) NULL, [iPPrice] [money] NULL, [cBatch] [nvarchar](60) NULL, [cVouchCode] [bigint] NULL, [cInVouchCode] [nvarchar](30) NULL, [cinvouchtype] [nvarchar](2) NULL, [iSOutQuantity] [decimal](30, 10) NULL, [iSOutNum] [decimal](30, 10) NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [iFlag] [tinyint] NOT NULL, [iFNum] [decimal](30, 10) NULL, [iFQuantity] [decimal](30, 10) NULL, [dVDate] [datetime] NULL, [iTrIds] [bigint] NULL, [cPosition] [nvarchar](20) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [cItem_class] [nvarchar](10) NULL, [cItemCode] [nvarchar](60) NULL, [cName] [nvarchar](255) NULL, [cItemCName] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [cBarCode] [nvarchar](200) NULL, [iNQuantity] [decimal](30, 10) NULL, [iNNum] [decimal](30, 10) NULL, [cAssUnit] [nvarchar](35) NULL, [dMadeDate] [datetime] NULL, [iMassDate] [int] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [iCheckIds] [bigint] NULL, [cBVencode] [nvarchar](20) NULL, [chVencode] [nvarchar](20) NULL, [bGsp] [bit] NULL, [cGspState] [nvarchar](20) NULL, [cCheckCode] [nvarchar](30) NULL, [iCheckIdBaks] [bigint] NULL, [cRejectCode] [nvarchar](30) NULL, [iRejectIds] [bigint] NULL, [cCheckPersonCode] [nvarchar](20) NULL, [dCheckDate] [datetime] NULL, [cMassUnit] [smallint] NULL, [bChecked] [bit] NULL, [bLPUseFree] [bit] NULL, [iRSRowNO] [int] NULL, [iOriTrackID] [bigint] NULL, [coritracktype] [nvarchar](2) NULL, [cbaccounter] [nvarchar](30) NULL, [dbKeepDate] [datetime] NULL, [bCosting] [bit] NULL, [bVMIUsed] [bit] NULL, [iVMISettleQuantity] [decimal](30, 10) NULL, [iVMISettleNum] [decimal](30, 10) NULL, [cvmivencode] [nvarchar](20) NULL, [iInvSNCount] [int] NULL, [cwhpersoncode] [nvarchar](20) NULL, [cwhpersonname] [nvarchar](50) NULL, [cserviceoid] [varchar](38) NULL, [cbserviceoid] [varchar](38) NULL, [iinvexchrate] [decimal](38, 8) NULL ) go CREATE TABLE [dbo].[RdRecord09]( sysid int identity(1,1), [ID] [bigint] NOT NULL, [bRdFlag] [tinyint] NOT NULL, [cVouchType] [nvarchar](2) NOT NULL, [cBusType] [nvarchar](12) NULL, [cSource] [nvarchar](50) NOT NULL, [cBusCode] [nvarchar](30) NULL, [cWhCode] [nvarchar](10) NOT NULL, [dDate] [datetime] NOT NULL, [cCode] [nvarchar](30) NOT NULL, [cRdCode] [nvarchar](5) NULL, [cDepCode] [nvarchar](12) NULL, [cPersonCode] [nvarchar](20) NULL, [cPTCode] [nvarchar](2) NULL, [cSTCode] [nvarchar](2) NULL, [cCusCode] [nvarchar](20) NULL, [cVenCode] [nvarchar](20) NULL, [cOrderCode] [nvarchar](30) NULL, [cARVCode] [nvarchar](30) NULL, [cBillCode] [bigint] NULL, [cDLCode] [bigint] NULL, [cProBatch] [nvarchar](60) NULL, [cHandler] [nvarchar](20) NULL, [cMemo] [nvarchar](255) NULL, [bTransFlag] [bit] NOT NULL, [cAccounter] [nvarchar](20) NULL, [cMaker] [nvarchar](20) NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [dKeepDate] [nvarchar](5) NULL, [dVeriDate] [datetime] NULL, [bpufirst] [bit] NULL, [biafirst] [bit] NULL, [iMQuantity] [float] NULL, [dARVDate] [datetime] NULL, [cChkCode] [nvarchar](30) NULL, [dChkDate] [datetime] NULL, [cChkPerson] [nvarchar](40) NULL, [VT_ID] [int] NULL, [bIsSTQc] [bit] NOT NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [gspcheck] [nvarchar](10) NULL, [ufts] [timestamp] NULL, [iExchRate] [float] NULL, [cExch_Name] [nvarchar](8) NULL, [cShipAddress] [nvarchar](200) NULL, [caddcode] [nvarchar](60) NULL, [bOMFirst] [bit] NULL, [bFromPreYear] [bit] NULL, [bIsLsQuery] [bit] NULL, [bIsComplement] [smallint] NULL, [iDiscountTaxType] [tinyint] NULL, [iBG_OverFlag] [smallint] NULL, [cBG_Auditor] [nvarchar](20) NULL, [cBG_AuditTime] [nvarchar](20) NULL, [ControlResult] [smallint] NULL, [ireturncount] [int] NULL, [iverifystate] [int] NULL, [iswfcontrolled] [int] NULL, [cModifyPerson] [nvarchar](50) NULL, [dModifyDate] [datetime] NULL, [dnmaketime] [datetime] NULL, [dnmodifytime] [datetime] NULL, [dnverifytime] [datetime] NULL, [bredvouch] [int] NULL, [iFlowId] [int] NULL, [cPZID] [nvarchar](30) NULL, [cSourceLs] [nvarchar](4) NULL, [cSourceCodeLs] [nvarchar](20) NULL, [iPrintCount] [int] NULL, [ctransflag] [nvarchar](2) NULL, [csysbarcode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [cCheckSignFlag] [nvarchar](36) NULL, importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), --0:未处理,1:已处理 direction int default(0) --0:从U8到中间库,1:从旺店通到中间库 ) go CREATE TABLE [dbo].[rdrecords09]( sysid int identity(1,1), [AutoID] [bigint] NOT NULL, [ID] [bigint] NOT NULL, [cInvCode] [nvarchar](60) NOT NULL, [iNum] [decimal](30, 10) NULL, [iQuantity] [decimal](30, 10) NULL, [iUnitCost] [decimal](30, 10) NULL, [iPrice] [money] NULL, [iAPrice] [money] NULL, [iPUnitCost] [decimal](30, 10) NULL, [iPPrice] [money] NULL, [cBatch] [nvarchar](60) NULL, [cVouchCode] [bigint] NULL, [cInVouchCode] [nvarchar](30) NULL, [cinvouchtype] [nvarchar](2) NULL, [iSOutQuantity] [decimal](30, 10) NULL, [iSOutNum] [decimal](30, 10) NULL, [coutvouchid] [bigint] NULL, [coutvouchtype] [nvarchar](2) NULL, [iSRedOutQuantity] [decimal](30, 10) NULL, [iSRedOutNum] [decimal](30, 10) NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [iFlag] [tinyint] NOT NULL, [iFNum] [decimal](30, 10) NULL, [iFQuantity] [decimal](30, 10) NULL, [dVDate] [datetime] NULL, [iTrIds] [bigint] NULL, [cPosition] [nvarchar](20) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [cItem_class] [nvarchar](10) NULL, [cItemCode] [nvarchar](60) NULL, [iDLsID] [bigint] NULL, [cName] [nvarchar](255) NULL, [cItemCName] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [cBarCode] [nvarchar](200) NULL, [iNQuantity] [decimal](30, 10) NULL, [iNNum] [decimal](30, 10) NULL, [cAssUnit] [nvarchar](35) NULL, [dMadeDate] [datetime] NULL, [iMassDate] [int] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [iCheckIds] [bigint] NULL, [cBVencode] [nvarchar](20) NULL, [bGsp] [bit] NULL, [cGspState] [nvarchar](20) NULL, [cCheckCode] [nvarchar](30) NULL, [iCheckIdBaks] [bigint] NULL, [cRejectCode] [nvarchar](30) NULL, [iRejectIds] [bigint] NULL, [cCheckPersonCode] [nvarchar](20) NULL, [dCheckDate] [datetime] NULL, [cMassUnit] [smallint] NULL, [bChecked] [bit] NULL, [iEqDID] [int] NULL, [bLPUseFree] [bit] NULL, [iRSRowNO] [int] NULL, [iOriTrackID] [bigint] NULL, [coritracktype] [nvarchar](2) NULL, [cbaccounter] [nvarchar](30) NULL, [dbKeepDate] [datetime] NULL, [bCosting] [bit] NULL, [bVMIUsed] [bit] NULL, [iVMISettleQuantity] [decimal](30, 10) NULL, [iVMISettleNum] [decimal](30, 10) NULL, [cvmivencode] [nvarchar](20) NULL, [iInvSNCount] [int] NULL, [cwhpersoncode] [nvarchar](20) NULL, [cwhpersonname] [nvarchar](50) NULL, [cserviceoid] [varchar](38) NULL, [cbserviceoid] [varchar](38) NULL, [iinvexchrate] [decimal](38, 8) NULL, [cbdlcode] [nvarchar](30) NULL ) go CREATE TABLE [dbo].[RdRecord01]( sysid int identity(1,1), [ID] [bigint] NOT NULL, [bRdFlag] [tinyint] NOT NULL, [cVouchType] [nvarchar](2) NOT NULL, [cBusType] [nvarchar](12) NULL, [cSource] [nvarchar](50) NOT NULL, [cBusCode] [nvarchar](30) NULL, [cWhCode] [nvarchar](10) NOT NULL, [dDate] [datetime] NOT NULL, [cCode] [nvarchar](30) NOT NULL, [cRdCode] [nvarchar](5) NULL, [cDepCode] [nvarchar](12) NULL, [cPersonCode] [nvarchar](20) NULL, [cPTCode] [nvarchar](2) NULL, [cSTCode] [nvarchar](2) NULL, [cCusCode] [nvarchar](20) NULL, [cVenCode] [nvarchar](20) NULL, [cOrderCode] [nvarchar](30) NULL, [cARVCode] [nvarchar](30) NULL, [cBillCode] [bigint] NULL, [cDLCode] [bigint] NULL, [cProBatch] [nvarchar](60) NULL, [cHandler] [nvarchar](20) NULL, [cMemo] [nvarchar](255) NULL, [bTransFlag] [bit] NOT NULL, [cAccounter] [nvarchar](20) NULL, [cMaker] [nvarchar](20) NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [dKeepDate] [nvarchar](5) NULL, [dVeriDate] [datetime] NULL, [bpufirst] [bit] NULL, [biafirst] [bit] NULL, [iMQuantity] [float] NULL, [dARVDate] [datetime] NULL, [cChkCode] [nvarchar](30) NULL, [dChkDate] [datetime] NULL, [cChkPerson] [nvarchar](40) NULL, [VT_ID] [int] NULL, [bIsSTQc] [bit] NOT NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [gspcheck] [nvarchar](10) NULL, [ipurorderid] [bigint] NULL, [ipurarriveid] [bigint] NULL, [iarriveid] [nvarchar](30) NULL, [isalebillid] [nvarchar](30) NULL, [ufts] [timestamp] NULL, [iTaxRate] [decimal](20, 6) NULL, [iExchRate] [float] NULL, [cExch_Name] [nvarchar](8) NULL, [bOMFirst] [bit] NULL, [bFromPreYear] [bit] NULL, [bIsLsQuery] [bit] NULL, [bIsComplement] [smallint] NULL, [iDiscountTaxType] [tinyint] NULL, [ireturncount] [int] NULL, [iverifystate] [int] NULL, [iswfcontrolled] [int] NULL, [cModifyPerson] [nvarchar](50) NULL, [dModifyDate] [datetime] NULL, [dnmaketime] [datetime] NULL, [dnmodifytime] [datetime] NULL, [dnverifytime] [datetime] NULL, [bredvouch] [int] NULL, [cVenPUOMProtocol] [nvarchar](20) NULL, [dCreditStart] [datetime] NULL, [iCreditPeriod] [int] NULL, [dGatheringDate] [datetime] NULL, [bCredit] [tinyint] NULL, [iFlowId] [int] NULL, [cPZID] [nvarchar](30) NULL, [cSourceLs] [nvarchar](4) NULL, [cSourceCodeLs] [nvarchar](20) NULL, [iPrintCount] [int] NULL, [csysbarcode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [cCheckSignFlag] [nvarchar](36) NULL, [cGCRouteCode] [nvarchar](40) NULL, importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0) --0:从U8到中间库,1:从旺店通到中间库 ) GO CREATE TABLE [dbo].[rdrecords01]( sysid int identity(1,1), [AutoID] [bigint] NOT NULL, [ID] [bigint] NOT NULL, [cInvCode] [nvarchar](60) NOT NULL, [iNum] [decimal](30, 10) NULL, [iQuantity] [decimal](30, 10) NULL, [iUnitCost] [decimal](30, 10) NULL, [iPrice] [money] NULL, [iAPrice] [money] NULL, [iPUnitCost] [decimal](30, 10) NULL, [iPPrice] [money] NULL, [cBatch] [nvarchar](60) NULL, [cVouchCode] [bigint] NULL, [cInVouchCode] [nvarchar](30) NULL, [cinvouchtype] [nvarchar](2) NULL, [iSOutQuantity] [decimal](30, 10) NULL, [iSOutNum] [decimal](30, 10) NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [iFlag] [tinyint] NOT NULL, [dSDate] [datetime] NULL, [iTax] [money] NULL, [iSQuantity] [decimal](30, 10) NULL, [iSNum] [decimal](30, 10) NULL, [iMoney] [money] NULL, [iFNum] [decimal](30, 10) NULL, [iFQuantity] [decimal](30, 10) NULL, [dVDate] [datetime] NULL, [cPosition] [nvarchar](20) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [cItem_class] [nvarchar](10) NULL, [cItemCode] [nvarchar](60) NULL, [iPOsID] [bigint] NULL, [fACost] [decimal](30, 10) NULL, [cName] [nvarchar](255) NULL, [cItemCName] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [cBarCode] [nvarchar](200) NULL, [iNQuantity] [decimal](30, 10) NULL, [iNNum] [decimal](30, 10) NULL, [cAssUnit] [nvarchar](35) NULL, [dMadeDate] [datetime] NULL, [iMassDate] [int] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [iCheckIds] [bigint] NULL, [cBVencode] [nvarchar](20) NULL, [chVencode] [nvarchar](20) NULL, [bGsp] [bit] NULL, [cGspState] [nvarchar](20) NULL, [iArrsId] [bigint] NULL, [cCheckCode] [nvarchar](30) NULL, [iCheckIdBaks] [bigint] NULL, [cRejectCode] [nvarchar](30) NULL, [iRejectIds] [bigint] NULL, [cCheckPersonCode] [nvarchar](20) NULL, [dCheckDate] [datetime] NULL, [iOriTaxCost] [decimal](20, 6) NULL, [iOriCost] [decimal](20, 6) NULL, [iOriMoney] [money] NULL, [iOriTaxPrice] [money] NULL, [ioriSum] [money] NULL, [iTaxRate] [decimal](20, 6) NULL, [iTaxPrice] [money] NULL, [iSum] [money] NULL, [bTaxCost] [bit] NULL, [cPOID] [nvarchar](30) NULL, [cMassUnit] [smallint] NULL, [iMaterialFee] [money] NULL, [iProcessCost] [decimal](30, 10) NULL, [iProcessFee] [money] NULL, [dMSDate] [datetime] NULL, [iSMaterialFee] [money] NULL, [iSProcessFee] [money] NULL, [iOMoDID] [int] NULL, [strContractId] [nvarchar](64) NULL, [strCode] [nvarchar](150) NULL, [bChecked] [bit] NULL, [bRelated] [bit] NULL, [iOMoMID] [bigint] NULL, [iMatSettleState] [int] NOT NULL, [iBillSettleCount] [int] NOT NULL, [bLPUseFree] [bit] NULL, [iOriTrackID] [bigint] NULL, [coritracktype] [nvarchar](2) NULL, [cbaccounter] [nvarchar](30) NULL, [dbKeepDate] [datetime] NULL, [bCosting] [bit] NULL, [iSumBillQuantity] [decimal](30, 10) NULL, [bVMIUsed] [bit] NULL, [iVMISettleQuantity] [decimal](30, 10) NULL, [iVMISettleNum] [decimal](30, 10) NULL, [cvmivencode] [nvarchar](20) NULL, [iInvSNCount] [int] NULL, [cwhpersoncode] [nvarchar](20) NULL, [cwhpersonname] [nvarchar](50) NULL, [impcost] [decimal](30, 10) NULL, [iIMOSID] [int] NULL, [iIMBSID] [int] NULL, [cbarvcode] [nvarchar](30) NULL, [dbarvdate] [nvarchar](30) NULL, [iinvexchrate] [decimal](30, 10) NULL, [corufts] [varchar](16) NULL, [comcode] [nvarchar](30) NULL, [strContractGUID] [uniqueidentifier] NULL, [iExpiratDateCalcu] [smallint] NULL ) go CREATE TABLE [dbo].[rdrecord11]( sysid int identity(1,1), importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0), --0:从U8到中间库,1:从旺店通到中间库 [ID] [bigint] NOT NULL, [bRdFlag] [tinyint] NOT NULL, [cVouchType] [nvarchar](2) NOT NULL, [cBusType] [nvarchar](12) NULL, [cSource] [nvarchar](50) NOT NULL, [cBusCode] [nvarchar](30) NULL, [cWhCode] [nvarchar](10) NOT NULL, [dDate] [datetime] NOT NULL, [cCode] [nvarchar](30) NOT NULL, [cRdCode] [nvarchar](5) NULL, [cDepCode] [nvarchar](12) NULL, [cPersonCode] [nvarchar](20) NULL, [cPTCode] [nvarchar](2) NULL, [cSTCode] [nvarchar](2) NULL, [cCusCode] [nvarchar](20) NULL, [cVenCode] [nvarchar](20) NULL, [cOrderCode] [nvarchar](30) NULL, [cARVCode] [nvarchar](30) NULL, [cBillCode] [bigint] NULL, [cDLCode] [bigint] NULL, [cProBatch] [nvarchar](60) NULL, [cHandler] [nvarchar](20) NULL, [cMemo] [nvarchar](255) NULL, [bTransFlag] [bit] NOT NULL, [cAccounter] [nvarchar](20) NULL, [cMaker] [nvarchar](20) NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [dKeepDate] [nvarchar](5) NULL, [dVeriDate] [datetime] NULL, [bpufirst] [bit] NULL, [biafirst] [bit] NULL, [iMQuantity] [float] NULL, [dARVDate] [datetime] NULL, [cChkCode] [nvarchar](30) NULL, [dChkDate] [datetime] NULL, [cChkPerson] [nvarchar](40) NULL, [VT_ID] [int] NULL, [bIsSTQc] [bit] NOT NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [cPsPcode] [nvarchar](60) NULL, [cMPoCode] [nvarchar](30) NULL, [gspcheck] [nvarchar](10) NULL, [ipurorderid] [bigint] NULL, [iproorderid] [int] NULL, [ufts] [timestamp] NULL, [iExchRate] [float] NULL, [cExch_Name] [nvarchar](8) NULL, [bOMFirst] [bit] NULL, [bFromPreYear] [bit] NULL, [bIsLsQuery] [bit] NULL, [bIsComplement] [smallint] NULL, [iDiscountTaxType] [tinyint] NULL, [ireturncount] [int] NULL, [iverifystate] [int] NULL, [iswfcontrolled] [int] NULL, [cModifyPerson] [nvarchar](50) NULL, [dModifyDate] [datetime] NULL, [dnmaketime] [datetime] NULL, [dnmodifytime] [datetime] NULL, [dnverifytime] [datetime] NULL, [bredvouch] [int] NULL, [bmotran] [tinyint] NULL, [iFlowId] [int] NULL, [cPZID] [nvarchar](30) NULL, [cSourceLs] [nvarchar](4) NULL, [cSourceCodeLs] [nvarchar](20) NULL, [bHYVouch] [bit] NULL, [iPrintCount] [int] NULL, [csysbarcode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [cCheckSignFlag] [nvarchar](36) NULL ) GO CREATE TABLE [dbo].[rdrecords11]( sysid int identity(1,1), [AutoID] [bigint] NOT NULL, [ID] [bigint] NOT NULL, [cInvCode] [nvarchar](60) NOT NULL, [iNum] [decimal](30, 10) NULL, [iQuantity] [decimal](30, 10) NULL, [iUnitCost] [decimal](30, 10) NULL, [iPrice] [money] NULL, [iAPrice] [money] NULL, [iPUnitCost] [decimal](30, 10) NULL, [iPPrice] [money] NULL, [cBatch] [nvarchar](60) NULL, [cObjCode] [nvarchar](12) NULL, [cVouchCode] [bigint] NULL, [cInVouchCode] [nvarchar](30) NULL, [cinvouchtype] [nvarchar](2) NULL, [iSOutQuantity] [decimal](30, 10) NULL, [iSOutNum] [decimal](30, 10) NULL, [coutvouchid] [bigint] NULL, [coutvouchtype] [nvarchar](2) NULL, [iSRedOutQuantity] [decimal](30, 10) NULL, [iSRedOutNum] [decimal](30, 10) NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [iFlag] [tinyint] NOT NULL, [iSQuantity] [decimal](30, 10) NULL, [iSNum] [decimal](30, 10) NULL, [iFNum] [decimal](30, 10) NULL, [iFQuantity] [decimal](30, 10) NULL, [dVDate] [datetime] NULL, [iTrIds] [bigint] NULL, [cPosition] [nvarchar](20) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [cItem_class] [nvarchar](10) NULL, [cItemCode] [nvarchar](60) NULL, [cName] [nvarchar](255) NULL, [cItemCName] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [cBarCode] [nvarchar](200) NULL, [iNQuantity] [decimal](30, 10) NULL, [iNNum] [decimal](30, 10) NULL, [cAssUnit] [nvarchar](35) NULL, [dMadeDate] [datetime] NULL, [iMassDate] [int] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [iMPoIds] [bigint] NULL, [iCheckIds] [bigint] NULL, [cBVencode] [nvarchar](20) NULL, [bGsp] [bit] NULL, [cGspState] [nvarchar](20) NULL, [cCheckCode] [nvarchar](30) NULL, [iCheckIdBaks] [bigint] NULL, [cRejectCode] [nvarchar](30) NULL, [iRejectIds] [bigint] NULL, [cCheckPersonCode] [nvarchar](20) NULL, [dCheckDate] [datetime] NULL, [cMassUnit] [smallint] NULL, [cMoLotCode] [nvarchar](60) NULL, [iMaterialFee] [money] NULL, [iProcessCost] [decimal](30, 10) NULL, [iProcessFee] [money] NULL, [dMSDate] [datetime] NULL, [iSMaterialFee] [money] NULL, [iSProcessFee] [money] NULL, [iOMoDID] [int] NULL, [bFilled] [bigint] NULL, [bChecked] [bit] NULL, [iOMoMID] [bigint] NULL, [cmworkcentercode] [nvarchar](8) NULL, [bLPUseFree] [bit] NULL, [iRSRowNO] [int] NULL, [iOriTrackID] [bigint] NULL, [coritracktype] [nvarchar](2) NULL, [cbaccounter] [nvarchar](30) NULL, [dbKeepDate] [datetime] NULL, [bCosting] [bit] NULL, [bVMIUsed] [bit] NULL, [iVMISettleQuantity] [decimal](30, 10) NULL, [iVMISettleNum] [decimal](30, 10) NULL, [cvmivencode] [nvarchar](20) NULL, [iInvSNCount] [int] NULL, [cwhpersoncode] [nvarchar](20) NULL, [cwhpersonname] [nvarchar](50) NULL, [iMaIDs] [bigint] NULL, [cserviceoid] [varchar](38) NULL, [cbserviceoid] [varchar](38) NULL, [iinvexchrate] [decimal](38, 8) NULL ) GO CREATE TABLE [dbo].[PO_Pomain]( sysid int identity(1,1), importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0), --0:从U8到中间库,1:从旺店通到中间库 [cPOID] [nvarchar](30) NULL, [dPODate] [datetime] NOT NULL, [cVenCode] [nvarchar](20) NULL, [cDepCode] [nvarchar](12) NULL, [cPersonCode] [nvarchar](20) NULL, [cPTCode] [nvarchar](2) NULL, [cArrivalPlace] [nvarchar](255) NULL, [cSCCode] [nvarchar](2) NULL, [cexch_name] [nvarchar](8) NULL, [nflat] [float] NULL, [iTaxRate] [float] NULL, [cPayCode] [nvarchar](3) NULL, [iCost] [money] NULL, [iBargain] [money] NULL, [cMemo] [nvarchar](255) NULL, [cState] [tinyint] NULL, [cPeriod] [nvarchar](12) NULL, [cMaker] [nvarchar](20) NULL, [cVerifier] [nvarchar](20) NULL, [cCloser] [nvarchar](20) NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [POID] [int] NOT NULL, [iVTid] [int] NOT NULL, [ufts] [timestamp] NULL, [cChanger] [nvarchar](20) NULL, [cBusType] [nvarchar](8) NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [cLocker] [nvarchar](20) NULL, [iDiscountTaxType] [tinyint] NULL, [iverifystateex] [int] NULL, [ireturncount] [int] NULL, [IsWfControlled] [bit] NULL, [cmaketime] [datetime] NULL, [cModifyTime] [datetime] NULL, [cAuditTime] [datetime] NULL, [cAuditDate] [datetime] NULL, [cModifyDate] [datetime] NULL, [cReviser] [nvarchar](40) NULL, [cVenPUOMProtocol] [nvarchar](20) NULL, [cChangVerifier] [nvarchar](40) NULL, [cChangAuditTime] [datetime] NULL, [cChangAuditDate] [datetime] NULL, [iBG_OverFlag] [smallint] NULL, [cBG_Auditor] [nvarchar](20) NULL, [cBG_AuditTime] [nvarchar](20) NULL, [ControlResult] [smallint] NULL, [iflowid] [int] NULL, [iPrintCount] [int] NULL, [dCloseDate] [datetime] NULL, [dCloseTime] [datetime] NULL, [ccleanver] [nvarchar](50) NULL, [cContactCode] [nvarchar](60) NULL, [cVenPerson] [nvarchar](100) NULL, [cVenBank] [nvarchar](200) NULL, [cVenAccount] [nvarchar](100) NULL, [cappcode] [nvarchar](64) NULL, [csysbarcode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [cGCRouteCode] [nvarchar](40) NULL, [bGCTransforming] [bit] NULL) GO CREATE TABLE [dbo].[PO_Podetails]( [ID] [int] NOT NULL, [cPOID] [nvarchar](30) NULL, [cInvCode] [nvarchar](60) NOT NULL, [iQuantity] [decimal](30, 10) NULL, [iNum] [decimal](30, 10) NULL, [iQuotedPrice] [decimal](30, 10) NULL, [iUnitPrice] [decimal](30, 10) NULL, [iMoney] [money] NULL, [iTax] [money] NULL, [iSum] [money] NULL, [iDisCount] [money] NULL, [iNatUnitPrice] [decimal](30, 10) NULL, [iNatMoney] [money] NULL, [iNatTax] [money] NULL, [iNatSum] [money] NULL, [iNatDisCount] [money] NULL, [dArriveDate] [datetime] NULL, [iReceivedQTY] [decimal](30, 10) NULL, [iReceivedNum] [decimal](30, 10) NULL, [iReceivedMoney] [money] NULL, [iInvQTY] [decimal](30, 10) NULL, [iInvNum] [decimal](30, 10) NULL, [iInvMoney] [money] NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [iNatInvMoney] [money] NULL, [iOriTotal] [money] NULL, [iTotal] [money] NULL, [iPerTaxRate] decimal(26,4) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [iflag] [tinyint] NULL, [cItemCode] [nvarchar](60) NULL, [cItem_class] [nvarchar](10) NULL, [PPCIds] [int] NULL, [cItemName] [nvarchar](255) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [bGsp] [tinyint] NULL, [POID] [int] NULL, [cUnitID] [nvarchar](35) NULL, [iTaxPrice] decimal(26,4) NULL, [iArrQTY] decimal(26,4) NULL, [iArrNum] decimal(26,4) NULL, [iArrMoney] [money] NULL, [iNatArrMoney] [money] NULL, [iAppIds] [int] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [iSOsID] [int] NULL, [bTaxCost] [bit] NULL, [cSource] [nvarchar](10) NULL, [cbCloser] [nvarchar](20) NULL, [iPPartId] [int] NULL, [iPQuantity] decimal(26,4) NULL, [iPTOSeq] [int] NULL, [SoType] [tinyint] NULL, [SoDId] [nvarchar](50) NULL, [ContractRowGUID] [uniqueidentifier] NULL, [cupsocode] [nvarchar](64) NULL, [iInvMPCost] [decimal](20, 6) NULL, [ContractCode] [nvarchar](128) NULL, [ContractRowNo] [nvarchar](150) NULL, [fPoValidQuantity] decimal(26,4) NULL, [fPoValidNum] decimal(26,4) NULL, [fPoArrQuantity] decimal(26,4) NULL, [fPoArrNum] decimal(26,4) NULL, [fPoRetQuantity] decimal(26,4) NULL, [fPoRetNum] decimal(26,4) NULL, [fPoRefuseQuantity] decimal(26,4) NULL, [fPoRefuseNum] decimal(26,4) NULL, [dUfts] [timestamp] NULL, [iorderdid] [int] NULL, [iordertype] [tinyint] NULL, [csoordercode] [nvarchar](50) NULL, [iorderseq] [int] NULL, [cbCloseTime] [datetime] NULL, [cbCloseDate] [datetime] NULL, [cBG_ItemCode] [nvarchar](50) NULL, [cBG_ItemName] [nvarchar](100) NULL, [cBG_CaliberKey1] [nvarchar](50) NULL, [cBG_CaliberKeyName1] [nvarchar](100) NULL, [cBG_CaliberKey2] [nvarchar](50) NULL, [cBG_CaliberKeyName2] [nvarchar](100) NULL, [cBG_CaliberKey3] [nvarchar](50) NULL, [cBG_CaliberKeyName3] [nvarchar](100) NULL, [cBG_CaliberCode1] [nvarchar](90) NULL, [cBG_CaliberName1] [nvarchar](100) NULL, [cBG_CaliberCode2] [nvarchar](90) NULL, [cBG_CaliberName2] [nvarchar](100) NULL, [cBG_CaliberCode3] [nvarchar](90) NULL, [cBG_CaliberName3] [nvarchar](100) NULL, [iBG_Ctrl] [tinyint] NULL, [cBG_Auditopinion] [nvarchar](100) NULL, [fexquantity] decimal(26,4) NULL, [fexnum] decimal(26,4) NULL, [ivouchrowno] [int] NULL, [cBG_CaliberKey4] [nvarchar](50) NULL, [cBG_CaliberKeyName4] [nvarchar](100) NULL, [cBG_CaliberKey5] [nvarchar](50) NULL, [cBG_CaliberKeyName5] [nvarchar](100) NULL, [cBG_CaliberKey6] [nvarchar](50) NULL, [cBG_CaliberKeyName6] [nvarchar](100) NULL, [cBG_CaliberCode4] [nvarchar](90) NULL, [cBG_CaliberName4] [nvarchar](100) NULL, [cBG_CaliberCode5] [nvarchar](90) NULL, [cBG_CaliberName5] [nvarchar](100) NULL, [cBG_CaliberCode6] [nvarchar](90) NULL, [cBG_CaliberName6] [nvarchar](100) NULL, [csocode] [nvarchar](40) NULL, [irowno] [int] NULL, [freceivedqty] decimal(26,4) NULL, [freceivednum] decimal(26,4) NULL, [cxjspdids] [nvarchar](60) NULL, [cbMemo] [nvarchar](255) NULL, [cbsysbarcode] [nvarchar](80) NULL, [planlotnumber] [nvarchar](40) NULL, [bgift] [smallint] NULL, [cFactoryCode] [nvarchar](50) NULL ) GO CREATE TABLE [dbo].[PU_ArrivalVouch]( sysid int identity(1,1), importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0), --0:从U8到中间库,1:从旺店通到中间库 [iVTid] [int] NOT NULL, [ufts] [timestamp] NULL, [ID] [int] NOT NULL, [cCode] [nvarchar](30) NOT NULL, [cPTCode] [nvarchar](2) NULL, [dDate] [datetime] NOT NULL, [cVenCode] [nvarchar](20) NOT NULL, [cDepCode] [nvarchar](12) NULL, [cPersonCode] [nvarchar](20) NULL, [cPayCode] [nvarchar](3) NULL, [cSCCode] [nvarchar](2) NULL, [cexch_name] [nvarchar](8) NOT NULL, [iExchRate] [float] NULL, [iTaxRate] [decimal](20, 6) NULL, [cMemo] [nvarchar](255) NULL, [cBusType] [nvarchar](8) NOT NULL, [cMaker] [nvarchar](20) NOT NULL, [bNegative] [int] NOT NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [ccloser] [nvarchar](20) NULL, [iDiscountTaxType] [tinyint] NULL, [iBillType] [tinyint] NOT NULL, [cvouchtype] [nvarchar](10) NULL, [cgeneralordercode] [nvarchar](300) NULL, [ctmcode] [nvarchar](30) NULL, [cincotermcode] [nvarchar](30) NULL, [ctransordercode] [nvarchar](30) NULL, [dportdate] [datetime] NULL, [csportcode] [nvarchar](30) NULL, [caportcode] [nvarchar](30) NULL, [csvencode] [nvarchar](30) NULL, [carrivalplace] [nvarchar](100) NULL, [dclosedate] [datetime] NULL, [idec] [int] NULL, [bcal] [bit] NULL, [guid] [nvarchar](50) NULL, [cMakeTime] [datetime] NULL, [cModifyTime] [datetime] NULL, [cModifyDate] [datetime] NULL, [cReviser] [nvarchar](40) NULL, [iverifystate] [int] NULL, [cAuditDate] [datetime] NULL, [caudittime] [datetime] NULL, [cverifier] [nvarchar](20) NULL, [iverifystateex] [int] NULL, [ireturncount] [int] NULL, [IsWfControlled] [bit] NULL, [cVenPUOMProtocol] [nvarchar](20) NULL, [cchanger] [nvarchar](20) NULL, [iflowid] [int] NULL, [iPrintCount] [int] NULL, [ccleanver] [nvarchar](50) NULL, [cpocode] [nvarchar](64) NULL, [csysbarcode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL) go CREATE TABLE [dbo].[PU_ArrivalVouchs]( [Autoid] [int] NOT NULL, [ID] [int] NULL, [cWhCode] [nvarchar](10) NULL, [cInvCode] [nvarchar](60) NOT NULL, [iNum] [decimal](20, 6) NULL, [iQuantity] [decimal](20, 6) NOT NULL, [iOriCost] [decimal](20, 6) NULL, [iOriTaxCost] [decimal](20, 6) NULL, [iOriMoney] [money] NULL, [iOriTaxPrice] [money] NULL, [iOriSum] [money] NULL, [iCost] [decimal](20, 6) NULL, [iMoney] [money] NULL, [iTaxPrice] [money] NULL, [iSum] [money] NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [iTaxRate] [decimal](20, 6) NOT NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [cItem_class] [nvarchar](2) NULL, [cItemCode] [nvarchar](60) NULL, [iPOsID] [int] NULL, [cItemName] [nvarchar](255) NULL, [cUnitID] [nvarchar](50) NULL, [fValidInQuan] [decimal](20, 6) NULL, [fKPQuantity] [decimal](20, 6) NULL, [fRealQuantity] [decimal](20, 6) NULL, [fValidQuantity] [decimal](20, 6) NULL, [finValidQuantity] [decimal](20, 6) NULL, [cCloser] [nvarchar](20) NULL, [iCorId] [int] NULL, [fRetQuantity] [decimal](20, 6) NULL, [fInValidInQuan] [decimal](20, 6) NULL, [bGsp] [tinyint] NULL, [cBatch] [nvarchar](60) NULL, [dVDate] [datetime] NULL, [dPDate] [datetime] NULL, [fRefuseQuantity] [decimal](20, 6) NULL, [cGspState] [nvarchar](20) NULL, [fValidNum] decimal(26,4) NULL, [fValidInNum] decimal(26,4) NULL, [fInValidNum] decimal(26,4) NULL, [fRealNum] decimal(26,4) NULL, [bTaxCost] [bit] NULL, [bInspect] [tinyint] NULL, [fRefuseNum] [decimal](20, 6) NULL, [iPPartId] [int] NULL, [iPQuantity] decimal(26,4) NULL, [iPTOSeq] [int] NULL, [SoDId] [nvarchar](50) NULL, [SoType] [tinyint] NULL, [ContractRowGUID] [uniqueidentifier] NULL, [imassdate] [int] NULL, [cmassunit] [tinyint] NULL, [bexigency] [tinyint] NULL, [cbcloser] [nvarchar](20) NULL, [fSumRefuseQuantity] [decimal](20, 6) NULL, [FSumRefuseNum] [decimal](20, 6) NULL, [fRetNum] [decimal](20, 6) NULL, [fDTQuantity] [decimal](20, 6) NULL, [fInvalidInNum] [decimal](20, 6) NULL, [fDegradeQuantity] [decimal](20, 6) NULL, [fDegradeNum] [decimal](20, 6) NULL, [fDegradeInQuantity] [decimal](20, 6) NULL, [fDegradeInNum] [decimal](20, 6) NULL, [fInspectQuantity] [decimal](20, 6) NULL, [fInspectNum] [decimal](20, 6) NULL, [iInvMPCost] [decimal](20, 6) NULL, [guids] [nvarchar](50) NULL, [iinvexchrate] [decimal](28, 8) NULL, [objectid_source] [nvarchar](30) NULL, [autoid_source] [int] NULL, [ufts_source] [nvarchar](50) NULL, [irowno_source] [int] NULL, [csocode] [nvarchar](50) NULL, [isorowno] [int] NULL, [iorderid] [int] NULL, [cordercode] [nvarchar](50) NULL, [iorderrowno] [int] NULL, [dlineclosedate] [datetime] NULL, [ContractCode] [nvarchar](128) NULL, [ContractRowNo] [nvarchar](150) NULL, [RejectSource] [bit] NULL, [iciqbookid] [int] NULL, [cciqbookcode] [nvarchar](30) NULL, [cciqcode] [nvarchar](30) NULL, [fciqchangrate] decimal(20,6) NULL, [irejectautoid] [int] NULL, [iExpiratDateCalcu] [smallint] NULL, [cExpirationdate] [nvarchar](20) NULL, [dExpirationdate] [datetime] NULL, [cupsocode] [nvarchar](120) NULL, [iorderdid] [int] NULL, [iordertype] [tinyint] NULL, [csoordercode] [nvarchar](50) NULL, [iorderseq] [int] NULL, [cBatchProperty1] [decimal](38, 8) NULL, [cBatchProperty2] [decimal](38, 8) NULL, [cBatchProperty3] [decimal](38, 8) NULL, [cBatchProperty4] [decimal](38, 8) NULL, [cBatchProperty5] [decimal](38, 8) NULL, [cBatchProperty6] [nvarchar](120) NULL, [cBatchProperty7] [nvarchar](120) NULL, [cBatchProperty8] [nvarchar](120) NULL, [cBatchProperty9] [nvarchar](120) NULL, [cBatchProperty10] [datetime] NULL, [ivouchrowno] [int] NULL, [irowno] [int] NULL, [cbMemo] [nvarchar](255) NULL, [cbsysbarcode] [nvarchar](80) NULL, [carrivalcode] [nvarchar](80) NULL, [ipickedquantity] [float] NULL, [ipickednum] [float] NULL, [iSourceMOCode] [nvarchar](60) NULL, [iSourceMODetailsID] [int] NULL, [freworkquantity] decimal(26,4) NULL, [freworknum] decimal(26,4) NULL, [fsumreworkquantity] decimal(26,4) NULL, [fsumreworknum] decimal(26,4) NULL, [iProductType] [tinyint] NULL, [cMainInvCode] [nvarchar](60) NULL, [iMainMoDetailsID] [int] NULL, [PlanLotNumber] [nvarchar](40) NULL, [bgift] [smallint] NULL, [cFactoryCode] [nvarchar](50) NULL ) go CREATE TABLE [dbo].[DispatchList]( sysid int identity(1,1), importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0), --0:从U8到中间库,1:从旺店通到中间库 [DLID] [int] NOT NULL, [cDLCode] [nvarchar](30) NULL, [cVouchType] [nvarchar](2) NOT NULL, [cSTCode] [nvarchar](2) NOT NULL, [dDate] [datetime] NOT NULL, [cRdCode] [nvarchar](5) NULL, [cDepCode] [nvarchar](12) NOT NULL, [cPersonCode] [nvarchar](20) NULL, [SBVID] [int] NULL, [cSBVCode] [nvarchar](255) NULL, [cSOCode] [nvarchar](30) NULL, [cCusCode] [nvarchar](20) NULL, [cPayCode] [nvarchar](3) NULL, [cSCCode] [nvarchar](2) NULL, [cShipAddress] [nvarchar](255) NULL, [cexch_name] [nvarchar](8) NOT NULL, [iExchRate] [float] NOT NULL, [iTaxRate] [float] NULL, [bFirst] [bit] NOT NULL, [bReturnFlag] [bit] NOT NULL, [bSettleAll] [bit] NOT NULL, [cMemo] [nvarchar](255) NULL, [cSaleOut] [nvarchar](255) NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [cVerifier] [nvarchar](20) NULL, [cMaker] [nvarchar](20) NULL, [iNetLock] [real] NULL, [iSale] [smallint] NULL, [cCusName] [nvarchar](120) NULL, [iVTid] [int] NOT NULL, [ufts] [timestamp] NULL, [cBusType] [nvarchar](8) NULL, [cCloser] [nvarchar](20) NULL, [cAccounter] [nvarchar](20) NULL, [cCreChpName] [nvarchar](20) NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [bIAFirst] [bit] NULL, [ioutgolden] [int] NULL, [cgatheringplan] [nvarchar](20) NULL, [dCreditStart] [datetime] NULL, [dGatheringDate] [datetime] NULL, [icreditdays] [int] NULL, [bCredit] [bit] NULL, [caddcode] [nvarchar](30) NULL, [iverifystate] [int] NULL, [ireturncount] [tinyint] NULL, [iswfcontrolled] [tinyint] NULL, [icreditstate] [varchar](20) NULL, [bARFirst] [bit] NULL, [cmodifier] [nvarchar](20) NULL, [dmoddate] [datetime] NULL, [dverifydate] [datetime] NULL, [ccusperson] [nvarchar](100) NULL, [dcreatesystime] [datetime] NULL, [dverifysystime] [datetime] NULL, [dmodifysystime] [datetime] NULL, [csvouchtype] [nvarchar](10) NULL, [iflowid] [int] NULL, [bsigncreate] [bit] NULL, [bcashsale] [bit] NULL, [cgathingcode] [nvarchar](255) NULL, [cChanger] [nvarchar](20) NULL, [cChangeMemo] [nvarchar](255) NULL, [outid] [uniqueidentifier] NULL, [bmustbook] [bit] NULL, [cBookDepcode] [nvarchar](12) NULL, [cBookType] [nvarchar](10) NULL, [bSaUsed] [bit] NULL, [bneedbill] [bit] NULL, [baccswitchflag] [bit] NULL, [iPrintCount] [int] NULL, [ccuspersoncode] [nvarchar](30) NULL, [cSourceCode] [nvarchar](60) NULL, [bsaleoutcreatebill] [bit] NULL, [cSysBarCode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [csscode] [nvarchar](3) NULL, [cinvoicecompany] [nvarchar](20) NULL, [fEBweight] [decimal](30, 9) NULL, [cEBweightUnit] [nvarchar](50) NULL, [cEBExpressCode] [nvarchar](50) NULL, [iEBExpressCoID] [bigint] NULL, [SeparateID] [int] NULL, [bNotToGoldTax] [tinyint] NULL, [cEBTrnumber] [nvarchar](80) NULL, [cEBBuyer] [nvarchar](2000) NULL, [cEBBuyerNote] [nvarchar](4000) NULL, [ccontactname] [nvarchar](255) NULL, [cEBprovince] [nvarchar](20) NULL, [cEBcity] [nvarchar](20) NULL, [cEBdistrict] [nvarchar](60) NULL, [cmobilephone] [nvarchar](50) NULL, [cInvoiceCusName] [nvarchar](255) NULL, [cweighter] [nvarchar](40) NULL, [dweighttime] [datetime] NULL, [cPickVouchCode] [nvarchar](255) NULL, [cGCRouteCode] [nvarchar](10) NULL ) go CREATE TABLE [dbo].[DispatchLists]( [AutoID] [int] IDENTITY(1,1) NOT NULL, [DLID] [int] NOT NULL, [iCorID] [int] NULL, [cWhCode] [nvarchar](10) NULL, [cInvCode] [nvarchar](60) NULL, [iQuantity] [decimal](30, 10) NULL, [iNum] [decimal](30, 10) NULL, [iQuotedPrice] [decimal](30, 10) NULL, [iUnitPrice] [decimal](30, 10) NULL, [iTaxUnitPrice] [decimal](30, 10) NULL, [iMoney] [money] NULL, [iTax] [money] NULL, [iSum] [money] NULL, [iDisCount] [money] NULL, [iNatUnitPrice] [decimal](30, 10) NULL, [iNatMoney] [money] NULL, [iNatTax] [money] NULL, [iNatSum] [money] NULL, [iNatDisCount] [money] NULL, [iSettleNum] [decimal](30, 10) NULL, [iSettleQuantity] [decimal](30, 10) NULL, [iBatch] [int] NULL, [cBatch] [nvarchar](60) NULL, [bSettleAll] [bit] NOT NULL, [cMemo] [nvarchar](255) NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [iTB] [tinyint] NULL, [dvDate] [datetime] NULL, [TBQuantity] [decimal](26, 9) NULL, [TBNum] [decimal](26, 9) NULL, [iSOsID] [int] NULL, [iDLsID] [int] NOT NULL, [KL] [decimal](30, 10) NULL, [KL2] [decimal](30, 10) NULL, [cInvName] [nvarchar](255) NULL, [iTaxRate] [decimal](30, 10) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [fOutQuantity] [decimal](30, 10) NULL, [fOutNum] [decimal](30, 10) NULL, [cItemCode] [nvarchar](60) NULL, [cItem_class] [nvarchar](10) NULL, [fSaleCost] [decimal](30, 10) NULL, [fSalePrice] [decimal](30, 10) NULL, [cVenAbbName] [nvarchar](60) NULL, [cItemName] [nvarchar](255) NULL, [cItem_CName] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [bIsSTQc] [bit] NULL, [iInvExchRate] decimal(26,4) NULL, [cUnitID] [nvarchar](35) NULL, [cCode] [nvarchar](30) NULL, [iRetQuantity] decimal(26,4) NULL, [fEnSettleQuan] decimal(26,4) NULL, [fEnSettleSum] [money] NULL, [iSettlePrice] [decimal](30, 10) NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [dMDate] [datetime] NULL, [bGsp] [bit] NULL, [cGspState] [nvarchar](20) NULL, [cSoCode] [nvarchar](30) NULL, [cCorCode] [nvarchar](30) NULL, [iPPartSeqID] [int] NULL, [iPPartID] [int] NULL, [iPPartQty] decimal(26,4) NULL, [cContractID] [nvarchar](64) NULL, [cContractTagCode] [nvarchar](150) NULL, [cContractRowGuid] [uniqueidentifier] ROWGUIDCOL NULL, [iMassDate] [int] NULL, [cMassUnit] [smallint] NULL, [bQANeedCheck] [bit] NOT NULL, [bQAUrgency] [bit] NOT NULL, [bQAChecking] [bit] NOT NULL, [bQAChecked] [bit] NOT NULL, [iQAQuantity] [decimal](30, 10) NULL, [iQANum] [decimal](30, 10) NULL, [cCusInvCode] [nvarchar](60) NULL, [cCusInvName] [nvarchar](100) NULL, [fsumsignquantity] [decimal](26, 9) NULL, [fsumsignnum] [decimal](26, 9) NULL, [cbaccounter] [nvarchar](30) NULL, [bcosting] [bit] NOT NULL, [cordercode] [nvarchar](30) NULL, [iorderrowno] [bigint] NULL, [fcusminprice] [decimal](26, 9) NULL, [icostquantity] [decimal](26, 9) NULL, [icostsum] [money] NULL, [ispecialtype] [tinyint] NULL, [cvmivencode] [nvarchar](20) NULL, [iexchsum] [money] NULL, [imoneysum] [money] NULL, [irowno] [bigint] NULL, [frettbquantity] [decimal](26, 9) NULL, [fretsum] [decimal](26, 9) NULL, [iExpiratDateCalcu] [smallint] NULL, [dExpirationdate] [datetime] NULL, [cExpirationdate] [nvarchar](20) NULL, [cbatchproperty1] [decimal](38, 8) NULL, [cbatchproperty2] [decimal](38, 8) NULL, [cbatchproperty3] [decimal](38, 8) NULL, [cbatchproperty4] [decimal](38, 8) NULL, [cbatchproperty5] [decimal](38, 8) NULL, [cbatchproperty6] [nvarchar](120) NULL, [cbatchproperty7] [nvarchar](120) NULL, [cbatchproperty8] [nvarchar](120) NULL, [cbatchproperty9] [nvarchar](120) NULL, [cbatchproperty10] [datetime] NULL, [dblPreExchMomey] [decimal](29, 6) NULL, [dblPreMomey] [decimal](29, 6) NULL, [idemandtype] [smallint] NULL, [cdemandcode] [nvarchar](40) NULL, [cdemandmemo] [nvarchar](300) NULL, [cdemandid] [nvarchar](30) NULL, [idemandseq] [bigint] NULL, [cvencode] [nvarchar](20) NULL, [cReasonCode] [nvarchar](10) NULL, [cInvSN] [nvarchar](200) NULL, [iInvSNCount] [int] NULL, [bneedsign] [bit] NULL, [bsignover] [bit] NULL, [bneedloss] [bit] NULL, [flossrate] [decimal](29, 6) NULL, [frlossqty] [decimal](29, 6) NULL, [fulossqty] [decimal](29, 6) NULL, [isettletype] [smallint] NULL, [crelacuscode] [nvarchar](20) NULL, [cLossMaker] [nvarchar](20) NULL, [dLossDate] [datetime] NULL, [dLossTime] [datetime] NULL, [icoridlsid] [bigint] NULL, [fretoutqty] [decimal](29, 6) NULL, [body_outid] [uniqueidentifier] NULL, [fVeriBillQty] [decimal](26, 9) NULL, [fVeriBillSum] [money] NULL, [fVeriRetQty] [decimal](26, 9) NULL, [fVeriRetSum] [money] NULL, [fLastSettleQty] [decimal](26, 9) NULL, [fLastSettleSum] [money] NULL, [cBookWhcode] [nvarchar](10) NULL, [cInVouchType] [nvarchar](2) NULL, [cPosition] [nvarchar](20) NULL, [fretqtywkp] [decimal](26, 9) NULL, [fretqtyykp] [decimal](26, 9) NULL, [frettbqtyykp] [decimal](26, 9) NULL, [fretsumykp] [decimal](26, 9) NULL, [dkeepdate] [datetime] NULL, [cSCloser] [nvarchar](20) NULL, [isaleoutid] [bigint] NULL, [bsaleprice] [bit] NULL, [bgift] [bit] NULL, [bmpforderclosed] [bit] NULL, [cbSysBarCode] [nvarchar](80) NULL, [fxjquantity] [float] NULL, [fxjnum] [float] NULL, [bIAcreatebill] [bit] NULL, [cParentCode] [nvarchar](50) NULL, [cChildCode] [nvarchar](50) NULL, [fchildqty] [decimal](30, 9) NULL, [fchildrate] [decimal](30, 9) NULL, [iCalcType] [tinyint] NULL, [fappretwkpqty] [decimal](30, 9) NULL, [fappretwkpsum] [decimal](30, 9) NULL, [fappretykpqty] [decimal](30, 9) NULL, [fappretykpsum] [decimal](30, 9) NULL, [fappretwkptbqty] [decimal](30, 9) NULL, [fappretykptbqty] [decimal](30, 9) NULL, [irtnappid] [bigint] NULL, [crtnappcode] [nvarchar](30) NULL, [fretailrealamount] [decimal](26, 9) NULL, [fretailsettleamount] [decimal](26, 9) NULL, [cFactoryCode] [nvarchar](50) NULL, [GCSourceId] [int] NULL, [GCSourceIds] [int] NULL) go CREATE TABLE [dbo].[SO_SOMain]( sysid int identity(1,1), importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0), --0:从U8到中间库,1:从旺店通到中间库 [cSTCode] [nvarchar](2) NOT NULL, [dDate] [datetime] NOT NULL, [cSOCode] [nvarchar](30) NULL, [cCusCode] [nvarchar](20) NULL, [cDepCode] [nvarchar](12) NOT NULL, [cPersonCode] [nvarchar](20) NULL, [cSCCode] [nvarchar](2) NULL, [cCusOAddress] [nvarchar](255) NULL, [cPayCode] [nvarchar](3) NULL, [cexch_name] [nvarchar](8) NOT NULL, [iExchRate] [float] NULL, [iTaxRate] [float] NULL, [iMoney] [money] NULL, [cMemo] [nvarchar](255) NULL, [iStatus] [tinyint] NULL, [cMaker] [nvarchar](20) NULL, [cVerifier] [nvarchar](20) NULL, [cCloser] [nvarchar](20) NULL, [bDisFlag] [bit] NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [bReturnFlag] [bit] NOT NULL, [cCusName] [nvarchar](120) NULL, [bOrder] [bit] NULL, [ID] [int] NOT NULL, [iVTid] [int] NOT NULL, [ufts] [timestamp] NULL, [cChanger] [nvarchar](20) NULL, [cBusType] [nvarchar](8) NOT NULL, [cCreChpName] [nvarchar](20) NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [coppcode] [nvarchar](60) NULL, [cLocker] [nvarchar](20) NULL, [dPreMoDateBT] [datetime] NULL, [dPreDateBT] [datetime] NULL, [cgatheringplan] [nvarchar](20) NULL, [caddcode] [nvarchar](30) NULL, [iverifystate] [int] NULL, [ireturncount] [tinyint] NULL, [iswfcontrolled] [tinyint] NULL, [icreditstate] [varchar](20) NULL, [cmodifier] [nvarchar](20) NULL, [dmoddate] [datetime] NULL, [dverifydate] [datetime] NULL, [ccusperson] [nvarchar](100) NULL, [dcreatesystime] [datetime] NULL, [dverifysystime] [datetime] NULL, [dmodifysystime] [datetime] NULL, [iflowid] [int] NULL, [bcashsale] [bit] NULL, [cgathingcode] [nvarchar](255) NULL, [cChangeVerifier] [nvarchar](20) NULL, [dChangeVerifyDate] [datetime] NULL, [dChangeVerifyTime] [datetime] NULL, [outid] [uniqueidentifier] NULL, [ccuspersoncode] [nvarchar](30) NULL, [dclosedate] [datetime] NULL, [dclosesystime] [datetime] NULL, [iPrintCount] [float] NULL, [fbookratio] [float] NULL, [bmustbook] [bit] NULL, [fbooksum] [money] NULL, [fbooknatsum] [money] NULL, [fgbooksum] [money] NULL, [fgbooknatsum] [money] NULL, [csvouchtype] [nvarchar](10) NULL, [cCrmPersonCode] [nvarchar](255) NULL, [cCrmPersonName] [nvarchar](255) NULL, [cMainPersonCode] [nvarchar](255) NULL, [cSysBarCode] [nvarchar](60) NULL, [ioppid] [int] NULL, [optnty_name] [nvarchar](255) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [contract_status] [smallint] NULL, [csscode] [nvarchar](3) NULL, [cinvoicecompany] [nvarchar](20) NULL, [cAttachment] [nvarchar](255) NULL, [cEBTrnumber] [nvarchar](80) NULL, [cEBBuyer] [nvarchar](2000) NULL, [cEBBuyerNote] [nvarchar](4000) NULL, [ccontactname] [nvarchar](255) NULL, [cEBprovince] [nvarchar](20) NULL, [cEBcity] [nvarchar](20) NULL, [cEBdistrict] [nvarchar](60) NULL, [cmobilephone] [nvarchar](50) NULL, [cInvoiceCusName] [nvarchar](255) NULL, [cGCRouteCode] [nvarchar](10) NULL) go CREATE TABLE [dbo].[SO_SODetails]( [AutoID] [int] IDENTITY(1,1) NOT NULL, [cSOCode] [nvarchar](30) NULL, [cInvCode] [nvarchar](60) NULL, [dPreDate] [datetime] NULL, [iQuantity] [decimal](30, 10) NULL, [iNum] [decimal](30, 10) NULL, [iQuotedPrice] [decimal](30, 10) NULL, [iUnitPrice] [decimal](30, 10) NULL, [iTaxUnitPrice] [decimal](30, 10) NULL, [iMoney] [money] NULL, [iTax] [money] NULL, [iSum] [money] NULL, [iDisCount] [money] NULL, [iNatUnitPrice] [decimal](30, 10) NULL, [iNatMoney] [money] NULL, [iNatTax] [money] NULL, [iNatSum] [money] NULL, [iNatDisCount] [money] NULL, [iFHNum] [decimal](30, 10) NULL, [iFHQuantity] [decimal](30, 10) NULL, [iFHMoney] [money] NULL, [iKPQuantity] [decimal](30, 10) NULL, [iKPNum] [decimal](30, 10) NULL, [iKPMoney] [money] NULL, [cMemo] [nvarchar](255) NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [bFH] [int] NULL, [iSOsID] [int] NOT NULL, [KL] [decimal](30, 10) NULL, [KL2] [decimal](30, 10) NULL, [cInvName] [nvarchar](255) NULL, [iTaxRate] [decimal](30, 10) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [cItemCode] [nvarchar](60) NULL, [cItem_class] [nvarchar](10) NULL, [cItemName] [nvarchar](255) NULL, [cItem_CName] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [iInvExchRate] decimal(26,4) NULL, [cUnitID] [nvarchar](35) NULL, [ID] [int] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [FPurQuan] decimal(26,4) NULL, [fSaleCost] [decimal](30, 10) NULL, [fSalePrice] [decimal](30, 10) NULL, [cQuoCode] [nvarchar](30) NULL, [iQuoID] [int] NULL, [cSCloser] [nvarchar](20) NULL, [dPreMoDate] [datetime] NULL, [iRowNo] [int] NULL, [iCusBomID] [int] NULL, [iMoQuantity] decimal(26,4) NULL, [cContractID] [nvarchar](64) NULL, [cContractTagCode] [nvarchar](150) NULL, [cContractRowGuid] [uniqueidentifier] ROWGUIDCOL NULL, [iPPartSeqID] [int] NULL, [iPPartID] [int] NULL, [iPPartQty] decimal(26,4) NULL, [cCusInvCode] [nvarchar](60) NULL, [cCusInvName] [nvarchar](100) NULL, [iPreKeepQuantity] decimal(26,4) NULL, [iPreKeepNum] decimal(26,4) NULL, [iPreKeepTotQuantity] decimal(26,4) NULL, [iPreKeepTotNum] decimal(26,4) NULL, [dreleasedate] [datetime] NULL, [fcusminprice] [decimal](26, 9) NULL, [fimquantity] [decimal](26, 9) NULL, [fomquantity] [decimal](26, 9) NULL, [ballpurchase] [bit] NULL, [finquantity] [decimal](26, 9) NULL, [icostquantity] [decimal](26, 9) NULL, [icostsum] [money] NULL, [foutquantity] [decimal](26, 9) NULL, [foutnum] [decimal](26, 9) NULL, [iexchsum] [money] NULL, [imoneysum] [money] NULL, [dufts] [timestamp] NULL, [iaoids] [int] NULL, [cpreordercode] [nvarchar](30) NULL, [fretquantity] [decimal](29, 6) NULL, [fretnum] [decimal](29, 6) NULL, [dbclosedate] [datetime] NULL, [dbclosesystime] [datetime] NULL, [bOrderBOM] [bit] NULL, [bOrderBOMOver] [tinyint] NULL, [idemandtype] [smallint] NULL, [cdemandcode] [nvarchar](40) NULL, [cdemandmemo] [nvarchar](300) NULL, [fPurSum] [decimal](26, 9) NULL, [fPurBillQty] [decimal](26, 9) NULL, [fPurBillSum] [decimal](26, 9) NULL, [iimid] [bigint] NULL, [ccorvouchtype] [nvarchar](10) NULL, [icorrowno] [int] NULL, [busecusbom] [bit] NULL, [body_outid] [uniqueidentifier] NULL, [fVeriDispQty] [decimal](26, 9) NULL, [fVeriDispSum] [money] NULL, [bsaleprice] [bit] NULL, [bgift] [bit] NULL, [forecastdid] [int] NULL, [cdetailsdemandcode] [nvarchar](40) NULL, [cdetailsdemandmemo] [nvarchar](300) NULL, [fTransedQty] [decimal](30, 10) NULL, [cbSysBarCode] [nvarchar](80) NULL, [fappqty] [decimal](30, 9) NULL, [cParentCode] [nvarchar](50) NULL, [cChildCode] [nvarchar](50) NULL, [fchildqty] [decimal](30, 9) NULL, [fchildrate] [decimal](30, 9) NULL, [iCalcType] [tinyint] NULL, [iCurPartid] [bigint] NULL, [cFactoryCode] [nvarchar](50) NULL, [GCSourceId] [int] NULL, [GCSourceIds] [int] NULL) go CREATE TABLE [dbo].[Customer]( sysid int identity(1,1), importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0), --0:从U8到中间库,1:从旺店通到中间库 [cCusCode] [nvarchar](20) NOT NULL, [cCusName] [nvarchar](98) NULL, [cCusAbbName] [nvarchar](60) NOT NULL, [cCCCode] [nvarchar](12) NULL, [cDCCode] [nvarchar](12) NULL, [cTrade] [nvarchar](50) NULL, [cCusAddress] [nvarchar](255) NULL, [cCusPostCode] [nvarchar](20) NULL, [cCusRegCode] [nvarchar](50) NULL, [cCusBank] [nvarchar](100) NULL, [cCusAccount] [nvarchar](50) NULL, [dCusDevDate] [datetime] NULL, [cCusLPerson] [nvarchar](100) NULL, [cCusEmail] [nvarchar](100) NULL, [cCusPerson] [nvarchar](50) NULL, [cCusPhone] [nvarchar](100) NULL, [cCusFax] [nvarchar](100) NULL, [cCusBP] [nvarchar](20) NULL, [cCusHand] [nvarchar](100) NULL, [cCusPPerson] [nvarchar](20) NULL, [iCusDisRate] [float] NULL, [cCusCreGrade] [nvarchar](6) NULL, [iCusCreLine] [float] NULL, [iCusCreDate] [int] NULL, [cCusPayCond] [nvarchar](20) NULL, [cCusOAddress] [nvarchar](255) NULL, [cCusOType] [nvarchar](10) NULL, [cCusHeadCode] [nvarchar](20) NULL, [cCusWhCode] [nvarchar](10) NULL, [cCusDepart] [nvarchar](12) NULL, [iARMoney] [float] NULL, [dLastDate] [datetime] NULL, [iLastMoney] [float] NULL, [dLRDate] [datetime] NULL, [iLRMoney] [float] NULL, [dEndDate] [datetime] NULL, [iFrequency] [int] NULL, [cCusDefine1] [nvarchar](20) NULL, [cCusDefine2] [nvarchar](20) NULL, [cCusDefine3] [nvarchar](20) NULL, [iCostGrade] [smallint] NULL, [cCreatePerson] [nvarchar](20) NULL, [cModifyPerson] [nvarchar](20) NULL, [dModifyDate] [datetime] NULL, [cRelVendor] [nvarchar](20) NULL, [iId] [nvarchar](40) NULL, [cPriceGroup] [nvarchar](20) NULL, [cOfferGrade] [nvarchar](20) NULL, [iOfferRate] [float] NULL, [cCusDefine4] [nvarchar](60) NULL, [cCusDefine5] [nvarchar](60) NULL, [cCusDefine6] [nvarchar](60) NULL, [cCusDefine7] [nvarchar](120) NULL, [cCusDefine8] [nvarchar](120) NULL, [cCusDefine9] [nvarchar](120) NULL, [cCusDefine10] [nvarchar](120) NULL, [cCusDefine11] [int] NULL, [cCusDefine12] [int] NULL, [cCusDefine13] [float] NULL, [cCusDefine14] [float] NULL, [cCusDefine15] [datetime] NULL, [cCusDefine16] [datetime] NULL, [pubufts] [timestamp] NULL, [cInvoiceCompany] [nvarchar](60) NULL, [bCredit] [bit] NOT NULL, [bCreditDate] [bit] NOT NULL, [bCreditByHead] [bit] NOT NULL, [bLicenceDate] [bit] NOT NULL, [dLicenceSDate] [datetime] NULL, [dLicenceEDate] [datetime] NULL, [iLicenceADays] [int] NULL, [bBusinessDate] [bit] NOT NULL, [dBusinessSDate] [datetime] NULL, [dBusinessEDate] [datetime] NULL, [iBusinessADays] [int] NULL, [bProxy] [bit] NOT NULL, [dProxySDate] [datetime] NULL, [dProxyEDate] [datetime] NULL, [iProxyADays] [int] NULL, [cMemo] [nvarchar](1000) NULL, [bLimitSale] [bit] NOT NULL, [cCusContactCode] [uniqueidentifier] NULL, [cCusCountryCode] [nvarchar](10) NULL, [cCusEnName] [nvarchar](100) NULL, [cCusEnAddr1] [nvarchar](60) NULL, [cCusEnAddr2] [nvarchar](60) NULL, [cCusEnAddr3] [nvarchar](60) NULL, [cCusEnAddr4] [nvarchar](60) NULL, [cCusPortCode] [nvarchar](10) NULL, [cPrimaryVen] [nvarchar](20) NULL, [fCommisionRate] [float] NULL, [fInsueRate] [float] NULL, [bHomeBranch] [bit] NOT NULL, [cBranchAddr] [nvarchar](255) NULL, [cBranchPhone] [nvarchar](100) NULL, [cBranchPerson] [nvarchar](50) NULL, [cCusTradeCCode] [nvarchar](12) NULL, [CustomerKCode] [nvarchar](4) NULL, [bCusState] [bit] NOT NULL, [bShop] [smallint] NULL, [cCusBankCode] [nvarchar](50) NULL, [cCusExch_name] [nvarchar](50) NULL, [iCusGSPType] [smallint] NOT NULL, [iCusGSPAuth] [smallint] NULL, [cCusGSPAuthNo] [nvarchar](120) NULL, [cCusBusinessNo] [nvarchar](120) NULL, [cCusLicenceNo] [nvarchar](20) NULL, [bCusDomestic] [bit] NOT NULL, [bCusOverseas] [bit] NOT NULL, [cCusCreditCompany] [nvarchar](20) NULL, [cCusSAProtocol] [nvarchar](20) NULL, [cCusExProtocol] [nvarchar](20) NULL, [cCusOtherProtocol] [nvarchar](20) NULL, [fCusDiscountRate] [float] NULL, [cCusSSCode] [nvarchar](20) NULL, [cCusCMProtocol] [nvarchar](20) NULL, [dCusCreateDatetime] [datetime] NOT NULL, [cCusAppDocNo] [nvarchar](50) NULL, [cCusMnemCode] [nvarchar](98) NULL, [fAdvancePaymentRatio] [float] NULL, [bServiceAttribute] [bit] NOT NULL, [bRequestSign] [bit] NOT NULL, [bOnGPinStore] [bit] NULL, [cCusMngTypeCode] [nvarchar](32) NULL, [account_type] [numeric](22, 0) NULL, [cCusImAgentProtocol] [nvarchar](20) NULL, [iSourceType] [smallint] NULL, [iSourceId] [varchar](20) NULL, [fExpense] [float] NULL, [fApprovedExpense] [float] NULL, [dTouchedTime] [datetime] NULL, [dRecentlyInvoiceTime] [datetime] NULL, [dRecentlyQuoteTime] [datetime] NULL, [dRecentlyActivityTime] [datetime] NULL, [dRecentlyChanceTime] [datetime] NULL, [dRecentlyContractTime] [datetime] NULL, [cLtcCustomerCode] [nvarchar](100) NULL, [bTransFlag] [bit] NULL, [cLtcPerson] [nvarchar](40) NULL, [dLtcDate] [datetime] NULL, [cLocationSite] [nvarchar](128) NULL, [iCusTaxRate] [float] NULL, [alloct_dept_time] [datetime] NULL, [allot_user_time] [datetime] NULL, [recyle_dept_time] [datetime] NULL, [recyle_pub_time] [datetime] NULL, [cLicenceNo] [nvarchar](120) NULL, [cLicenceRange] [nvarchar](255) NULL, [cCusBusinessRange] [nvarchar](255) NULL, [cCusGSPAuthRange] [nvarchar](255) NULL, [dCusGSPEDate] [datetime] NULL, [dCusGSPSDate] [datetime] NULL, [iCusGSPADays] [int] NULL, [bIsCusAttachFile] [bit] NULL, [dRecentContractDate] [datetime] NULL, [dRecentDeliveryDate] [datetime] NULL, [dRecentOutboundDate] [datetime] NULL, [cProvince] [nvarchar](255) NULL, [cCity] [nvarchar](255) NULL, [cCounty] [nvarchar](255) NULL, [cCusAddressGUID] [uniqueidentifier] NULL, [cAddCode] [nvarchar](30) NULL, [cCreditAddCode] [nvarchar](18) NULL, [cRegCash] [nvarchar](60) NULL, [dDepBeginDate] [datetime] NULL, [iEmployeeNum] [int] NULL, [cURL] [nvarchar](50) NULL, [PictureGUID] [uniqueidentifier] NULL ) alter table RdRecord08 add newcode nvarchar(60) null alter table RdRecord09 add newcode nvarchar(60) null alter table RdRecord01 add newcode nvarchar(60) null --alter table RdRecord32 add newcode nvarchar(60) null alter table so_somain add newcode nvarchar(60) null alter table po_pomain add newcode nvarchar(60) null alter table dispatchlist add newcode nvarchar(60) null alter table PU_ArrivalVouch add newcode nvarchar(60) null alter table transtime add lasttime2 datetime alter table rdrecords08 add text_flag bigint alter table rdrecords09 add text_flag bigint go insert into transtime(entitytype) values('供应商') insert into transtime(entitytype) values('仓库') insert into transtime(entitytype) values('存货') insert into transtime(entitytype) values('其他入库') insert into transtime(entitytype) values('其他出库') insert into transtime(entitytype) values('采购订单') insert into transtime(entitytype) values('采购入库') insert into transtime(entitytype) values('采购退货') insert into transtime(entitytype) values('销售退货') insert into transtime(entitytype) values('销售订单') insert into transtime(entitytype) values('材料出库') insert into transtime(entitytype) values('组装入库') insert into transtime(entitytype) values('组装出库') insert into transtime(entitytype) values('委外加工') go create index i_importdate on rdrecord08(importdate) create index i_importdate on rdrecord09(importdate) create index i_importdate on rdrecord01(importdate) create index i_importdate on PU_ArrivalVouch(importdate) create index i_importdate on PO_Pomain(importdate) create index i_importdate on DispatchList(importdate) create index i_importdate on SO_SOMain(importdate) go create index i_id on rdrecord08(id) create index i_id on rdrecord09(id) create index i_id on rdrecord01(id) create index i_id on PU_ArrivalVouch(id) create index i_id on PO_Pomain(poid) create index i_id on DispatchList(dlid) create index i_id on SO_SOMain(id) go create index i_id on rdrecords08(id) create index i_id on rdrecords09(id) create index i_id on rdrecords01(id) create index i_id on PU_ArrivalVouchs(id) create index i_id on PO_Podetails(poid) create index i_id on DispatchLists(dlid) create index i_id on SO_SOdetails(id) go alter table so_somain add platform_id nvarchar(50) go alter table inventory add cInvDefine1 nvarchar(20) alter table inventory add cInvDefine2 nvarchar(20) alter table inventory add cInvDefine3 nvarchar(20) alter table inventory add cInvDefine4 nvarchar(60) alter table inventory add cInvDefine5 nvarchar(60) alter table inventory add cInvDefine6 nvarchar(60) alter table inventory add cInvDefine7 nvarchar(120) alter table inventory add cInvDefine8 nvarchar(120) alter table inventory add cInvDefine9 nvarchar(120) alter table inventory add cInvDefine10 nvarchar(120) alter table inventory add cInvDefine11 int alter table inventory add cInvDefine12 int alter table inventory add cInvDefine13 decimal(26,4) alter table inventory add cInvDefine14 decimal(26,4) alter table inventory add fRetailPrice decimal(26,4) go alter table vendor add contact nvarchar(30) alter table vendor add phone nvarchar(100) alter table vendor add mobile nvarchar(100) alter table vendor add fax nvarchar(100) alter table vendor add email nvarchar(100) alter table vendor add cVenDefine11 int alter table vendor add cVenDefine1 nvarchar(20) alter table vendor add cVenDefine2 nvarchar(20) alter table vendor add cVenDefine3 nvarchar(20) alter table vendor add cVenDefine4 nvarchar(60) alter table vendor add cVenDefine5 nvarchar(60) alter table vendor add cVenDefine6 nvarchar(60) alter table vendor add cVenDefine7 nvarchar(120) alter table vendor add address nvarchar(255) alter table vendor add cmemo nvarchar(240) alter table vendor add bank_acc_number nvarchar(120) alter table vendor add bank_open nvarchar(120) go --销售出库单 CREATE TABLE [dbo].[rdrecord32]( [ID] [bigint] NOT NULL, [bRdFlag] [tinyint] NOT NULL, [cVouchType] [nvarchar](2) NOT NULL, [cBusType] [nvarchar](12) NULL, [cSource] [nvarchar](50) NOT NULL, [cBusCode] [nvarchar](30) NULL, [cWhCode] [nvarchar](10) NOT NULL, [dDate] [datetime] NOT NULL, [cCode] [nvarchar](30) NOT NULL, [cRdCode] [nvarchar](5) NULL, [cDepCode] [nvarchar](12) NULL, [cPersonCode] [nvarchar](20) NULL, [cPTCode] [nvarchar](2) NULL, [cSTCode] [nvarchar](2) NULL, [cCusCode] [nvarchar](20) NULL, [cVenCode] [nvarchar](20) NULL, [cOrderCode] [nvarchar](30) NULL, [cARVCode] [nvarchar](30) NULL, [cBillCode] [bigint] NULL, [cDLCode] [bigint] NULL, [cProBatch] [nvarchar](60) NULL, [cHandler] [nvarchar](20) NULL, [cMemo] [nvarchar](255) NULL, [bTransFlag] [bit] NOT NULL, [cAccounter] [nvarchar](20) NULL, [cMaker] [nvarchar](20) NULL, [cDefine1] [nvarchar](20) NULL, [cDefine2] [nvarchar](20) NULL, [cDefine3] [nvarchar](20) NULL, [cDefine4] [datetime] NULL, [cDefine5] [int] NULL, [cDefine6] [datetime] NULL, [cDefine7] [float] NULL, [cDefine8] [nvarchar](4) NULL, [cDefine9] [nvarchar](8) NULL, [cDefine10] [nvarchar](60) NULL, [dKeepDate] [nvarchar](5) NULL, [dVeriDate] [datetime] NULL, [bpufirst] [bit] NULL, [biafirst] [bit] NULL, [iMQuantity] [float] NULL, [dARVDate] [datetime] NULL, [cChkCode] [nvarchar](30) NULL, [dChkDate] [datetime] NULL, [cChkPerson] [nvarchar](40) NULL, [VT_ID] [int] NULL, [bIsSTQc] [bit] NOT NULL, [cDefine11] [nvarchar](120) NULL, [cDefine12] [nvarchar](120) NULL, [cDefine13] [nvarchar](120) NULL, [cDefine14] [nvarchar](120) NULL, [cDefine15] [int] NULL, [cDefine16] [float] NULL, [gspcheck] [nvarchar](10) NULL, [isalebillid] [nvarchar](30) NULL, [ufts] [timestamp] NULL, [iExchRate] [float] NULL, [cExch_Name] [nvarchar](8) NULL, [cShipAddress] [nvarchar](200) NULL, [caddcode] [nvarchar](60) NULL, [bOMFirst] [bit] NULL, [bFromPreYear] [bit] NULL, [bIsLsQuery] [bit] NULL, [bIsComplement] [smallint] NULL, [iDiscountTaxType] [tinyint] NULL, [ireturncount] [int] NULL, [iverifystate] [int] NULL, [iswfcontrolled] [int] NULL, [cModifyPerson] [nvarchar](50) NULL, [dModifyDate] [datetime] NULL, [dnmaketime] [datetime] NULL, [dnmodifytime] [datetime] NULL, [dnverifytime] [datetime] NULL, [bredvouch] [int] NULL, [iFlowId] [int] NULL, [cPZID] [nvarchar](30) NULL, [cSourceLs] [nvarchar](4) NULL, [cSourceCodeLs] [nvarchar](20) NULL, [iPrintCount] [int] NULL, [csysbarcode] [nvarchar](60) NULL, [cCurrentAuditor] [nvarchar](200) NULL, [cinvoicecompany] [nvarchar](20) NULL, [fEBweight] [decimal](30, 9) NULL, [cEBweightUnit] [nvarchar](50) NULL, [cEBExpressCode] [nvarchar](50) NULL, [bScanExpress] [tinyint] NULL, [cinspector] [nvarchar](40) NULL, [dinspecttime] [datetime] NULL, [cweighter] [nvarchar](40) NULL, [dweighttime] [datetime] NULL, [bUpLoaded] [tinyint] NULL, [outid] [uniqueidentifier] NULL, [isMDdispatch] [tinyint] NULL, [cCheckSignFlag] [nvarchar](36) NULL, [cGCRouteCode] [nvarchar](40) NULL, sysid int identity(1,1), importdate datetime null default(getdate()), processdate datetime null, processflag bit default(0), direction int default(0), --0:从U8到中间库,1:从旺店通到中间库 ) create index i_id on rdrecord32(id) GO CREATE TABLE [dbo].[rdrecords32]( [AutoID] [bigint] NOT NULL, [ID] [bigint] NOT NULL, [cInvCode] [nvarchar](60) NOT NULL, [iNum] [decimal](30, 10) NULL, [iQuantity] [decimal](30, 10) NULL, [iUnitCost] [decimal](30, 10) NULL, [iPrice] [money] NULL, [iAPrice] [money] NULL, [iPUnitCost] [decimal](30, 10) NULL, [iPPrice] [money] NULL, [cBatch] [nvarchar](60) NULL, [cVouchCode] [bigint] NULL, [cInVouchCode] [nvarchar](30) NULL, [cinvouchtype] [nvarchar](2) NULL, [iSOutQuantity] [decimal](30, 10) NULL, [iSOutNum] [decimal](30, 10) NULL, [coutvouchid] [bigint] NULL, [coutvouchtype] [nvarchar](2) NULL, [iSRedOutQuantity] [decimal](30, 10) NULL, [iSRedOutNum] [decimal](30, 10) NULL, [cFree1] [nvarchar](20) NULL, [cFree2] [nvarchar](20) NULL, [iFlag] [tinyint] NOT NULL, [iFNum] [decimal](30, 10) NULL, [iFQuantity] [decimal](30, 10) NULL, [dVDate] [datetime] NULL, [cPosition] [nvarchar](20) NULL, [cDefine22] [nvarchar](60) NULL, [cDefine23] [nvarchar](60) NULL, [cDefine24] [nvarchar](60) NULL, [cDefine25] [nvarchar](60) NULL, [cDefine26] [float] NULL, [cDefine27] [float] NULL, [cItem_class] [nvarchar](10) NULL, [cItemCode] [nvarchar](60) NULL, [iDLsID] [bigint] NULL, [iSBsID] [bigint] NULL, [iSendQuantity] [decimal](30, 10) NULL, [iSendNum] [decimal](30, 10) NULL, [iEnsID] [int] NULL, [cName] [nvarchar](255) NULL, [cItemCName] [nvarchar](20) NULL, [cFree3] [nvarchar](20) NULL, [cFree4] [nvarchar](20) NULL, [cFree5] [nvarchar](20) NULL, [cFree6] [nvarchar](20) NULL, [cFree7] [nvarchar](20) NULL, [cFree8] [nvarchar](20) NULL, [cFree9] [nvarchar](20) NULL, [cFree10] [nvarchar](20) NULL, [cBarCode] [nvarchar](200) NULL, [iNQuantity] [decimal](30, 10) NULL, [iNNum] [decimal](30, 10) NULL, [cAssUnit] [nvarchar](35) NULL, [dMadeDate] [datetime] NULL, [iMassDate] [int] NULL, [cDefine28] [nvarchar](120) NULL, [cDefine29] [nvarchar](120) NULL, [cDefine30] [nvarchar](120) NULL, [cDefine31] [nvarchar](120) NULL, [cDefine32] [nvarchar](120) NULL, [cDefine33] [nvarchar](120) NULL, [cDefine34] [int] NULL, [cDefine35] [int] NULL, [cDefine36] [datetime] NULL, [cDefine37] [datetime] NULL, [iCheckIds] [bigint] NULL, [cBVencode] [nvarchar](20) NULL, [bGsp] [bit] NULL, [cGspState] [nvarchar](20) NULL, [cCheckCode] [nvarchar](30) NULL, [iCheckIdBaks] [bigint] NULL, [cRejectCode] [nvarchar](30) NULL, [iRejectIds] [bigint] NULL, [cCheckPersonCode] [nvarchar](20) NULL, [dCheckDate] [datetime] NULL, [cMassUnit] [smallint] NULL, [iRefundInspectFlag] [tinyint] NULL, [strContractId] [nvarchar](64) NULL, [strCode] [nvarchar](150) NULL, [bChecked] [bit] NULL, [iEqDID] [int] NULL, [bLPUseFree] [bit] NULL, [iRSRowNO] [int] NULL, [iOriTrackID] [bigint] NULL, [coritracktype] [nvarchar](2) NULL, [cbaccounter] [nvarchar](30) NULL, [dbKeepDate] [datetime] NULL, [bCosting] [bit] NULL, [bVMIUsed] [bit] NULL, [iVMISettleQuantity] [decimal](30, 10) NULL, [iVMISettleNum] [decimal](30, 10) NULL, [cvmivencode] [nvarchar](20) NULL, [iInvSNCount] [int] NULL, [cwhpersoncode] [nvarchar](20) NULL, [cwhpersonname] [nvarchar](50) NULL, [cserviceoid] [varchar](38) NULL, [cbserviceoid] [varchar](38) NULL, [iinvexchrate] [decimal](38, 8) NULL, [cbdlcode] [nvarchar](30) NULL, sysid int identity(1,1) ) create index i_id on rdrecords32(id) go