报表报错“违反了 PRIMARY KEY 约束,“PK_t_userdetailfunc”.
金蝶云社区-zhangmingda666
zhangmingda666
0人赞赏了该文章 4,123次浏览 未经作者许可,禁止转载编辑于2017年08月28日 22:15:25

账套由专业版14.1 数据升级过来的,当时是用迁移工具20170323,升级至旗舰版V2.0的,升级过程无异常
再由旗舰版自带的升级工具,升级账套时报错以下错误:
最后账套使用其他的也没什么问题,但是打开报表,做修改时报错。

执行文件D:\PROGRAM FILES (X86)\KINGDEE\K3ERP\K3EXPRESS\KDSYSTEM\KDCOM\SqlSrv\SP_KISUEV4.0ICData_Public.sql出错。
错误描述:违反了 PRIMARY KEY 约束 'PK_ItemClass'。不能在对象 'dbo.t_ItemClass' 中插入重复键。
错误语句:
--[NO SQL FILE INFOMATION]
--if not exists(select top 1 1 from t_ItemClass where FItemClassID=9997 and FNumber='wlcompany')
--insert t_ItemClass(FItemClassID,FNumber,FName,FName_cht,FName_en,FSQLTableName,FVersion,FImport,FBrNo,FUserDefilast,FType,FGRType,FRemark,FGrControl,UUID)
--select 9997,'wlcompany','物流公司','物流公司','WLcompany',null,0,0,0,100,1,0,null,0,NEWID()
--Go
if not exists(select top 1 1 from t_ItemClass where FItemClassID=9998 and FNumber='wdhtype')
insert t_ItemClass(FItemClassID,FNumber,FName,FName_cht,FName_en,FSQLTableName,FVersion,FImport,FBrNo,FUserDefilast,FType,FGRType,FRemark,FGrControl,UUID)
select 9998,'wdhtype','上架商品类别','上架商品类别','WDHType',null,0,0,0,100,1,0,null,0,NEWID()

执行文件D:\PROGRAM FILES (X86)\KINGDEE\K3ERP\K3EXPRESS\KDSYSTEM\KDCOM\SqlSrv\SP_KISUEV4.0ICData_Public.sql出错。
错误描述:违反了 PRIMARY KEY 约束 'PK_ItemClass'。不能在对象 'dbo.t_ItemClass' 中插入重复键。
错误语句:
--[NO SQL FILE INFOMATION]
if not exists(select top 1 1 from t_ItemClass where FItemClassID=9999 and FNumber='weixin')
insert t_ItemClass(FItemClassID,FNumber,FName,FName_cht,FName_en,FSQLTableName,FVersion,FImport,FBrNo,FUserDefilast,FType,FGRType,FRemark,FGrControl,UUID)
select 9999,'weixin','微信用户','微信用户','WeiXinUser',null,0,0,0,100,1,0,null,0,NEWID()

执行文件D:\PROGRAM FILES (X86)\KINGDEE\K3ERP\K3EXPRESS\KDSYSTEM\KDCOM\SqlSrv\SP_KISUEV4.2ICData_Public.sql出错。
错误描述:违反了 PRIMARY KEY 约束 'PK_ItemClass'。不能在对象 'dbo.t_ItemClass' 中插入重复键。
错误语句:
--[NO SQL FILE INFOMATION]
if not exists(select top 1 1 from t_ItemClass where FItemClassID=9998 and FNumber='wdhtype')
insert t_ItemClass(FItemClassID,FNumber,FName,FName_cht,FName_en,FSQLTableName,FVersion,FImport,FBrNo,FUserDefilast,FType,FGRType,FRemark,FGrControl,UUID)
select 9998,'wdhtype','上架商品类别','上架商品类别','WDHType',null,0,0,0,100,1,0,null,0,NEWID()

执行文件D:\PROGRAM FILES (X86)\KINGDEE\K3ERP\K3EXPRESS\KDSYSTEM\KDCOM\SqlSrv\SP_KISUEV4.2ICData_Public.sql出错。
错误描述:违反了 PRIMARY KEY 约束 'PK_ItemClass'。不能在对象 'dbo.t_ItemClass' 中插入重复键。
错误语句:
--[NO SQL FILE INFOMATION]
if not exists(select top 1 1 from t_ItemClass where FItemClassID=9999 and FNumber='weixin')
insert t_ItemClass(FItemClassID,FNumber,FName,FName_cht,FName_en,FSQLTableName,FVersion,FImport,FBrNo,FUserDefilast,FType,FGRType,FRemark,FGrControl,UUID)
select 9999,'weixin','微信用户','微信用户','WeiXinUser',null,0,0,0,100,1,0,null,0,NEWID()