|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
大家在升级G6-E时都应该是从通系列使用T3升级T6工具升级数据之后
再用T6.6.1升级G6-E 11.0工具升级数据吧?
但是有部分问题无法使用工具解决,再升级N个数据之后,我把问题总结了一下发上来给大家分享一下。
有部分问题是需要进数据库表里设计表时进行修改就可以解决
例如ERSON表 将字段改为40
vander表 也是修改相应字段
还有部分数据需要执行SQL语句才能解决
数据库名: UFDATA_001_2013
采购数据库程序, DPRO_PU
错误信息:
-2147217900
列名 'cFree3' 无效。
执行如下语句时出错:
ALTER Procedure PU_BatchRDToBV(
@sMaker varchar(20),
@CurPBVCode varchar(10),
@sPBVType varchar(2),
@sCurrency varchar(10),
@bCal bit,
@iExchRate Float,
@iUPriceBit tinyint,
@iTaxRate Float,
@bNeg bit,
@sCurDay Varchar(12),
@sUserName varchar(20),
@ID int,
@iVtid varchar(10),
@bRet bit output
)
As
Set NOCOUNT ON
/* 入库单表头表体信息 */
Declare @sRDID varchar(10)
Declare @sRDSID varchar(10)
Declare @sRDCode varchar(10)
Declare @sVenCode varchar(20)
Declare @sPTCode varchar(2)
Declare @sPerson varchar(8)
Declare @sMemo varchar(30)
Declare @sDept varchar(12)
Declare @dDateRD datetime
Declare @sPOCode varchar(10)
Declare @sVouchType varchar(2)
Declare @bOri bit
Declare @sWh varchar(10)
Declare @iBVTax Decimal(20,2)
Declare @iOriBVTax Decimal(20,2)
Declare @iBVSum Money
Declare @iOriBVSum Money
Declare @iBVMoney Money
Declare @iOriBVMoney Money
Declare @CurMaxID1 Decimal(10,0) /* 发票主表中的最大ID号 */
Declare @CurMaxID2 Decimal(10,0) /* 最大单据号表中的发票主表ID号 */
Declare @CurPBVID Decimal(10,0)
Declare @CurMaxID3 Decimal(10,0) /* 发票子表中的最大ID号 */
Declare @CurMaxID4 Decimal(10,0) /* 最大单据号表中的发票子表ID号 */
Declare @CurPBVSID Decimal(10,0)
/* 表头自定义项 */
Declare @sDefine1 varchar(20)
Declare @sDefine2 varchar(20)
Declare @sDefine3 varchar(20)
Declare @sDefine8 varchar(4)
Declare @sDefine9 varchar(8)
Declare @sDefine10 varchar(60)
Declare @sDefine4 datetime
Declare @sDefine6 datetime
Declare @sDefine5 Int
Declare @sDefine7 Float
Declare @sDefine11 varchar(60)
Declare @sDefine12 varchar(60)
Declare @sDefine13 varchar(60)
Declare @sDefine14 varchar(60)
Declare @sDefine15 Int
Declare @sDefine16 Float
/* 表体自定义项 */
Declare @iPOsID varchar(20)
Declare @iRdsID varchar(20)
Declare @sDefine22 varchar(60)
Declare @sDefine23 varchar(60)
Declare @sDefine24 varchar(60)
Declare @sDefine25 varchar(60)
Declare @sDefine26 Float
Declare @sDefine27 Float
Declare @sDefine28 varchar(60)
Declare @sDefine29 varchar(60)
Declare @sDefine30 varchar(60)
Declare @sDefine31 varchar(60)
Declare @sDefine32 varchar(60)
Declare @sDefine33 varchar(60)
Declare @sDefine34 Int
Declare @sDefine35 Int
Declare @sDefine36 datetime
Declare @sDefine37 datetime
Declare @cAssUnit varchar(60)
Declare @sItemClass varchar(10)
Declare @sItemCode varchar(20)
Declare @sItemName varchar(60)
/* 表体自由项 */
Declare @sFree1 varchar(20)
Declare @sFree2 varchar(20)
Declare @sFree3 varchar(20)
Declare @sFree4 varchar(20)
Declare @sFree5 varchar(20)
Declare @sFree6 varchar(20)
Declare @sFree7 varchar(20)
Declare @sFree8 varchar(20)
Declare @sFree9 varchar(20)
Declare @sFree10 varchar(20)
Declare @sInv varchar(20)
Declare @iUnitCost float
Declare @iOriUnitCost float
Declare @iQuan float
Declare @iNum float
Declare @iPrice Money
/* 其他变量 */
Declare @iOriLen tinyint
Declare @iNewLen tinyint
Declare @iTotalCount Int
Declare @sCurTime Datetime
Declare @sBusType varchar(8)
Declare @iGoodBVMake Int
Declare @iBadBVMake Int
Declare @iCountLockB int
Declare @sErr varchar(1024)
/* 初始化 */
Set @sBusType='普通采购'
Set @iGoodBVMake=0
Set @iBadBVMake=0
Set @iCountLockB=0
Set @CurMaxID1=0
Set @CurMaxID2=0
Set @CurMaxID3=0
Set @CurMaxID4=0
Set @CurPBVID=0
Set @CurPBVSID=0
-- 2000.12.30 处理远程标志号
SET @bRet=0
Declare cur_rd CURSOR FOR SELECT cWhCode,cCode,cVenCode,cPTCode,cPersonCode,cDepCode,cMemo,dDate,cOrderCode,cVouchType,
cDefine1,cDefine2,cDefine3,cDefine4,cDefine5,cDefine6,cDefine7,cDefine8,cDefine9,cDefine10,cDefine11,cDefine12,cDefine13,cDefine14,cDefine15,cDefine16 FROM rdrecord where id=@ID and isnull(cBillCode,'')=''
OPEN cur_rd
FETCH NEXT FROM cur_rd INTO @sWh,@sRDCode,@sVenCode,@sPTCode,@sPerson,@sDept,@sMemo,@dDateRD,@sPOCode,@sVouchType,
@sDefine1,@sDefine2,@sDefine3,@sDefine4,@sDefine5,@sDefine6,@sDefine7,@sDefine8,@sDefine9,@sDefine10,@sDefine11,@sDefine12,@sDefine13,@sDefine14,@sDefine15,@sDefine16
if @@FETCH_STATUS=0
BEGIN
SET @bRet=1
BEGIN TRANSACTION
--Reget:
exec PU_GetID 'PurBill',1,@MaxID=@CurPBVID OUTPUT
Insert Into PurBillVouch(iVTID,PBVID,cPBVBillType,cPBVCode,cPTCode,dPBVDate,cVenCode,cUnitCode,cDepCode,cPersonCode,
cPayCode,cexch_name,cExchRate,iPBVTaxRate,cPBVMemo,cOrderCode,cInCode,cBusType,cSource,
dSDate,cPBVMaker,cPBVVerifier,bNegative,bOriginal,bFirst,
cDefine1,cDefine2,cDefine3,cDefine4,cDefine5,cDefine6,cDefine7,cDefine8,cDefine9,
cDefine10,cDefine11,cDefine12,cDefine13,cDefine14,cDefine15,cDefine16)
Select @iVtid,@CurPBVID,@sPBVType,@CurPBVCode,@sPTCode,@sCurDay,@sVenCode,@sVenCode,@sDept,@sPerson,
NULL,@sCurrency,@iExchRate,@iTaxRate,@sMemo,@sPOCode,@sRDCode,@sBusType,'采购',
NULL,@sMaker,NULL,@bNeg,0,0,
@sDefine1,@sDefine2,@sDefine3,@sDefine4,@sDefine5,@sDefine6,@sDefine7,@sDefine8,@sDefine9,
@sDefine10,@sDefine11,@sDefine12,@sDefine13,@sDefine14,@sDefine15,@sDefine16
print '1'
if @@ERROR<>0
SET @bRet=0
else
Begin
DeClare cur_rds CURSOR FOR SELECT AutoID,cInvCode,iUnitCost,iQuantity,iNum,iPrice,iPOsID,AutoID,cDefine22,cDefine23,cDefine24,cDefine25,cDefine26,cDefine27,cDefine28,cDefine29,cDefine30,cDefine31,cDefine32,cDefine33,cDefine34,cDefine35,cDefine36,cDefine37,
cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,cAssUnit,cItem_class,cItemCode,cName FROM rdrecords
where ID=@ID and dsdate is null Order By autoid
OPEN cur_rds
FETCH NEXT FROM cur_rds INTO @sRDSID,@sInv,@iUnitCost,@iQuan,@iNum,@iPrice,@iPOsID,@iRdsID,@sDefine22,@sDefine23,@sDefine24,@sDefine25,@sDefine26,@sDefine27,@sDefine28,@sDefine29,@sDefine30,@sDefine31,@sDefine32,@sDefine33,@sDefine34,@sDefine35,@sDefine36,@sDefine37,
@sFree1,@sFree2,@sFree3,@sFree4,@sFree5,@sFree6,@sFree7,@sFree8,@sFree9,@sFree10,@cAssUnit,@sItemClass,@sItemCode,@sItemName
if @@FETCH_STATUS=1
SET @bRet=0
else
print '2'
While @@FETCH_STATUS=0
Begin
exec PU_GetID 'PurBills',1,@MaxID=@CurPBVSID OUTPUT
-- 2001.02.13
-- 针对普通发票/专用发票区分计算
if @sPBVType='01' --专用发票税额=金额 *税率
Begin
/* 计算本币税额,本币价税合计,本币金额 */
Set @iBVTax=Convert(Decimal(20,2),@iPrice * @iTaxRate/100)
Set @iBVSum= Convert(Money,Convert(Decimal(20,2),@iPrice) +@iBVTax)
Set @iBVMoney=@iPrice
--根据汇率换算关系求原币金额
if @bCal=1
Begin
if @iExchRate<>0 Set @iOriBVMoney=Convert(Money,Convert(Decimal(20,2), @iBVMoney / @iExchRate))
End
Else
Begin
if @iExchRate<>0 Set @iOriBVMoney=Convert(Money,Convert(Decimal(20,2), @iBVMoney * @iExchRate))
End
-- 2001.02.13
-- 现象:原币单价=原币金额/数量存在误差
-- 解决: 如果汇率=1,原币单价=本币单价
if @iQuan<>0
Begin
if @iExchRate=1 Set @iOriUnitCost=@iUnitCost
else Set @iOriUnitCost=Convert(Float,ltrim(str(@iOriBVMoney [url=]/@iQuan,20,@iUPriceBit[/url])))
End
Set @iOriBVTax=Convert(Decimal(20,2),@iOriBVMoney * @iTaxRate/100)
Set @iOriBVSum= Convert(Money,Convert(Decimal(20,2),@iOriBVMoney) +@iOriBVTax)
End
Else --普通发票税额=价税合计*税率,金额=价税合计-税额
Begin
Set @iBVSum=@iPrice
Set @iBVTax=Convert(Decimal(20,2),@iBVSum * @iTaxRate/100)
Set @iBVMoney=Convert(Decimal(20,2),@iBVSum - @iBVTax)
if @bCal=1
Begin
if @iExchRate<>0 Set @iOriBVSum=Convert(Money,Convert(Decimal(20,2), @iBVSum / @iExchRate))
End
Else
Begin
if @iExchRate<>0 Set @iOriBVSum=Convert(Money,Convert(Decimal(20,2), @iBVSum * @iExchRate))
End
/* 求原币单价,原币税额,原币金额 */
if @iQuan<>0
Begin
if @iExchRate=1 Set @iOriUnitCost=@iUnitCost
else Set @iOriUnitCost=Convert(Float,ltrim(str(@iOriBVSum [url=]/@iQuan,20,@iUPriceBit[/url])))
End
Set @iOriBVTax=Convert(Decimal(20,2),@iOriBVSum * @iTaxRate/100)
Set @iOriBVMoney= Convert(Decimal(20,2),@iOriBVSum-@iOriBVTax)
End
-- 增强的检测
if (@iExchRate IS NULL) OR (@iOriUnitCost IS NULL)
Goto Next1
-- 2001.04.27 写发票子表的项目和项目大类
Insert Into PurBillVouchs(ID,PBVID,cInvCode,bExBill,dInDate,iPBVQuantity,iNum,
iOriCost,iOriMoney,iOriTaxPrice,iOriSum ,iCost,iMoney,iTaxPrice,iSum,iTaxRate,
iPOsID,RdsID,cDefine22,cDefine23,cDefine24,cDefine25,cDefine26,cDefine27,cDefine28,cDefine29,cDefine30,cDefine31,cDefine32,cDefine33,cDefine34,cDefine35,cDefine36,cDefine37,
cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,cUnitID,cItem_Class,cItemCode,cItemName)
Select @CurPBVSID,@curPBVID,@sInv,0,NULL,@iQuan,@iNum,
@iOriUnitCost,@iOriBVMoney,@iOriBVTax,@iOriBVSum,@iUnitCost,@iBVMoney,@iBVTax,@iBVSum,@iTaxRate,
@iPOsID,@iRdsID,@sDefine22,@sDefine23,@sDefine24,@sDefine25,@sDefine26,@sDefine27,@sDefine28,@sDefine29,@sDefine30,@sDefine31,@sDefine32,@sDefine33,@sDefine34,@sDefine35,@sDefine36,@sDefine37,
@sFree1,@sFree2,@sFree3,@sFree4,@sFree5,@sFree6,@sFree7,@sFree8,@sFree9,@sFree10,@cAssUnit,@sItemClass,@sItemCode,@sItemName
print '3'
if @@Error<>0
Begin
SET @bRet=0
Break
End
else
update po_podetails set iInvQTY=@iQuan,iInvNum=@iNum,iInvMoney=@iOriBVMoney,iNatInvMoney=@iBVMoney where id=@iposid
Next1:
-- 处理下一条子表记录
FETCH NEXT FROM cur_rds INTO @sRDSID,@sInv,@iUnitCost,@iQuan,@iNum,@iPrice,@iPOsID,@iRdsID,@sDefine22,@sDefine23,@sDefine24,@sDefine25,@sDefine26,@sDefine27,@sDefine28,@sDefine29,@sDefine30,@sDefine31,@sDefine32,@sDefine33,@sDefine34,@sDefine35,@sDefine36,@sDefine37,
@sFree1,@sFree2,@sFree3,@sFree4,@sFree5,@sFree6,@sFree7,@sFree8,@sFree9,@sFree10,@cAssUnit,@sItemClass,@sItemCode,@sItemName
end
Close cur_rds
DEALLOCATE cur_rds
end
print @bRet
if @bRet=0
ROLLBACK TRANSACTION
else
begin
Update RdRecord Set cBillCode=@CurPBVID Where ID=@ID
COMMIT TRANSACTION
set @bRet=1
end
end
Close cur_rd
DEALLOCATE cur_rd
解决办法:
ALTER TABLE ProductStructures
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE PurBillVouchs
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE PurSettleVouchs
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE PO_Podetails
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE SA_Account
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE SaleBillVouchs
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE SaleRelation
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE SaleRelation_Bak
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE EnDispatchs
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE ScrapVouchs
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE SO_SODetails
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE ST_TotalAccount
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
ALTER TABLE DispatchLists
ADD cFree3 varchar(20),cFree4 varchar(20),cFree5 varchar(20),cFree6 varchar(20),cFree7 varchar(20),
cFree8 varchar(20),cFree9 varchar(20),cFree10 varchar(20)
问题
数据库名: UFDATA_001_2013
公共部分数据结构, DSTR2_Public
错误信息:
-2147217900
索引 'UnionKey' 依赖于 列 'ID'。
执行如下语句时出错:
--2002.11.22 侯毓保
Alter Table LockVouch alter column ID varchar(40) NOT NULL
解决办法 更改VARCHAR
数据库名: UFDATA_001_2013
Data_STR_GL_AssQuery, Data_STR_GL_AssQuery
错误信息:
-2147217873
ALTER TABLE 语句与 COLUMN FOREIGN KEY 约束 'FK_GL_accvouch_SettleStyle' 冲突。该冲突发生于数据库 'UFDATA_001_2013',表 'SettleStyle', column 'cSSCode'。
执行如下语句时出错:
----- 增加结算方式在凭证表的外键
if not exists(select * from sysobjects where name = 'FK_GL_accvouch_SettleStyle' and type = 'F')
ALTER TABLE [dbo].[GL_accvouch] ADD CONSTRAINT [FK_GL_accvouch_SettleStyle] FOREIGN KEY
(
[csettle]
) REFERENCES [SettleStyle] (
[cSSCode]
)
解决办法
update gl_accvouch set csettle=null where csettle is not null
稍稍总结一下 希望给大家一些启发
|
|