专业版迁移
金蝶云社区-powercaramon
powercaramon
0人赞赏了该文章 766次浏览 未经作者许可,禁止转载编辑于2017年10月28日 17:04:45

专业版12.2迁移时提示迁移未成功,查看日志,提示如下:
语句已终止。
将截断字符串或二进制数据。/************************************************************************************************
* Project Name: 实现KISV10.0专业版到K/3V12.0成长版现金系统 *
* Modified BY: Weixy *
* Modified DATE: 2009-07-23 *
* Descriptions: *
* 1. 现金相关系统参数迁移 *
* 2. 现金数据迁移 *
* *
***********************************************************************************************/
---===========插入t_Item前先删除触发器t_Item_AutoNumber,插入完成后在补上,否则插入过程会报错========
Drop TRIGGER t_Item_AutoNumber
/************************/
/***** 现金系统迁移 *****/
/************************/
--???? todo 银行类型,需要客户交互
--增加核算项目(科目银行帐号)
--检查银行帐号和银行名称是否重复
declare @count int
select @count = 0
--数据检查
select distinct FYhzh, FYHMC into #tmp from kis_cn_account where FYhzh <> ''
select @count = count(*) from #tmp group by FYhzh having count(*)> 1
--If @count = 0
-- select @count = count(*) from #tmp group by FYHMC having count(*)> 1
If @count = 0
begin
declare @FAcntName nvarchar(100)
select @FAcntName = FValue from t_systemprofile where FCategory = 'General' and FKey = 'CompanyName'
delete t_item where FItemclassID = 2024
select Identity(int, 1, 1) as FInterID, FYhzh, FYhmc, null as FID into #tmp1 from (select distinct FYhzh, FYhmc from kis_cn_account where FYhzh <> '') a
declare @FItemID int
select @FItemID = max(FItemID) from t_Item
insert into t_item(FItemID, FItemClassID, FExternID, FNumber, FLevel, FDetail, FName, FUnUsed, FBrNo, FFullNumber, FDiff, FDeleted, FShortNumber,
FFullName, FGRCommonID, FSystemType, FUseSign, FGrControl, FAccessory, FParentID)
select @FItemID + FInterID as FItemID, 2024 as FItemClassID, -1 as FExternID, FYhzh as FNumber, 1 as FLevel, 1 as FDetail,
FYhmc as FName, 0 as FUnUsed, 0 as FBrNo, FYhzh as FFullNumber, 0 as FDiff, 0 as FDeleted, FYhzh as FShortNumber, FYhmc as FFullName,
-1 as FGRCommonID, 1 as FSystemType, 0 as FUseSign, -1 as FGrControl, 0 as FAccessory, 0 as FParentID
from #tmp1 --(select distinct FYhzh, FYhmc from kis_cn_account)
-- update #tmp1 set FID = b.FID from #tmp1 a left join t_submessage b on a.FYHMC like left(b.FName,6)+ '%' and FTypeID = 451
-- where a.FID is null
-- update #tmp1 set FID = b.FID from #tmp1 a left join t_submessage b on a.FYHMC like left(b.FName,4)+ '%' and FTypeID = 451
-- where a.FID is null
-- update #tmp1 set FID = b.FID from #tmp1 a left join t_submessage b on a.FYHMC like SUBSTRING(b.FName,3, 4)+ '%' and FTypeID = 451
-- where a.FID is null
-- update #tmp1 set FID = 999 where FID is null --999 其他银行
delete t_BK_Acnt
insert into t_BK_Acnt(FItemID, FAcntNumber, FAcntName, FAcntBranch, --FAcntBranchNumber, FAcntAreaCode, FAcntAreaName, FAcntUserNumber, FAcntDeptNumber, FModifyTime, FIdentifier,
FBankTypeID, FReadOnly, FUseCMBGroupPay, FExp, FDeleted, FSource, FFrameWork, FIsInnerAccount)
select @FItemID + FInterID as FItemID, FYhzh as FAcntNumber, @FAcntName as FAcntName, FYHMC as FAcntBranch, --as FAcntBranchNumber,
15505 as FBankTypeID, 0 as FReadOnly, 0 as FUseCMBGroupPay, null as FExp, 0 as FDeleted, 1 as FSource, 0 as FFrameWork, 0 as FIsInnerAccount
from #tmp1
--写日志
insert into KIS_UpdateLog (FDate,FItem,FLogMsg,FSQLFile) values (GetDate(),N'KIS现金系统-科目银行帐号核算项目',N'成功迁移'+ convert(varchar(20),@@Rowcount) +'条数据.','KIS_K3V12CN_ALL.SQL')
drop table #tmp1
end
else --有重复记录,取第一条
--写日志
insert into KIS_UpdateLog (FDate,FItem,FLogMsg,FSQLFile) values (GetDate(),N'KIS现金系统-科目银行帐号核算项目',N'迁移失败!!!出纳管理-出纳初始数据-银行帐号或银行名称有重复不能转换为核算项目.','KIS_K3V12CN_ALL.SQL')
drop table #tmp

红色字体为错误,请问大概是哪里有问题,有哪位大神知道吗