使用模块:总账、固定资产和报表
系统环境:WIdows 2003+SQL2008R2
问题描述:旗舰版V2.0账套升级到WISE13.1账套正常。将13.1账套备份在14.2版本中进行账套恢复后,进行账套升级,在进度条90%时报错如下:
执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP_KSEV14.2ICTemplate_Bos.sql出错。
错误描述:违反了 PRIMARY KEY 约束 'PK_ICClassTableInfo'。不能在对象 'dbo.ICClassTableInfo' 中插入重复键。
错误语句:
--TEAM=SCM,DBA=efeng_zhong TEL=2512
/******************************************************************************
* BUG/REQUIREMENT ID: PT093946 *
* DESCRIPTION: 组装单中显示列”库存数量“ *
* BY: hongbo_liang *
* DATE: 2014.11.18 *
******************************************************************************/
DECLARE @FTabIndex AS INT
SELECT @FTabIndex=FTabIndex FROM ICClassTableInfo WHERE fclasstypeid=1007000 AND FPage=2 AND FCaption_CHS='数量'
IF EXISTS( SELECT TOP 1 1 FROM ICClassTableInfo WHERE fclasstypeid=1007000 AND FPage=2 AND FCaption_CHS='即时库存')
BEGIN
DELETE FROM ICClassTableInfo WHERE fclasstypeid=1007000 AND FPage=2 AND FCaption_CHS='即时库存'
END
UPDATE ICClassTableInfo SET FTabIndex=FTabIndex+2
WHERE fclasstypeid=1007000 AND FPage=2 AND FTabIndex > @FTabIndex
INSERT INTO ICClassTableInfo(FClassTypeID,FPage,FCaption_CHS,FCaption_CHT,FCaption_EN,FKey,FFieldName,FTableName,
FTableNameAs,FListIndex,FListClassName,FVisible,FEnable ,FNeedSave,FMustInput,FCtlType,FProperty,
FLookUpType,FLookUpClassID,FLookUpList,FSRCFieldName,FSRCTableName,FSRCTableNameAs,FDSPFieldName,
FFNDFieldName,FValueLocation,FFilter,FFilterGroup,FValueType,FDspColType,FEditlen,FValuePrecision,
FSaveRule,FDefValue,FAction,FUserDefine,FNote,FKeyWord,FLeft,FTop,FHeight,FWidth,FCondition,FTabIndex,
FLock,FSum,FPrec,FScale,FLayer,FLoadAction,FUnControl,FFont,FSourceType,FSubKey,FParentKey,FConditionExt,
FFrameBorder,FFrameBorderColor,FLabelWidth,FLabelColor,FTextColor,FIsF7,FContainer,FStyle)
VALUES ( 1007000 , -- FClassTypeID - int
2 , -- FPage - smallint
'即时库存' , -- FCaption_CHS - varchar(50)
'即時庫存' , -- FCaption_CHT - varchar(50)
'' , -- FCaption_EN - varchar(255)
'FQty1' , -- FKey - varchar(50)
'FStockQty' , -- FFieldName - varchar(50)
'ICChangeEntry' , -- FTableName - varchar(50)
'' , -- FTableNameAs - varchar(20)
103 , -- FListIndex - int
0 , -- FListClassName - smallint
253 , -- FVisible - int
0 , -- FEnable - int
0 , -- FNeedSave - bit
0 , -- FMustInput - bit
2 , -- FCtlType - int
'FUnitID' , -- FProperty - varchar(50)
0 , -- FLookUpType - int
0 , -- FLookUpClassID - int
'' , -- FLookUpList - ntext
'' , -- FSRCFieldName - varchar(50)
'' , -- FSRCTableName - varchar(50)
'' , -- FSRCTableNameAs - varchar(50)
'' , -- FDSPFieldName - varchar(50)
'' , -- FFNDFieldName - varchar(50)
1 , -- FValueLocation - int
'' , -- FFilter - varchar(255)
'' , -- FFilterGroup - varchar(255)
106 , -- FValueType - int
2 , -- FDspColType - int
28 , -- FEditlen - smallint
13 , -- FValuePrecision - int
'' , -- FSaveRule - text
'' , -- FDefValue - varchar(100)
'' , -- FAction - text
1 , -- FUserDefine - bit
'' , -- FNote - nvarchar(100)
'QTY' , -- FKeyWord - varchar(50)
0 , -- FLeft - smallint
0 , -- FTop - smallint
350 , -- FHeight - smallint
2000 , -- FWidth - smallint
'1,13' , -- FCondition - varchar(30)
@FTabIndex+1 , -- FTabIndex - smallint
-1 , -- FLock - int
0 , -- FSum - bit
28 , -- FPrec - smallint
10 , -- FScale - smallint
0 , -- FLayer - smallint
'' , -- FLoadAction - text
24593 , -- FUnControl - int
'' , -- FFont - nvarchar(200)
0 , -- FSourceType - int
'' , -- FSubKey - varchar(255)
'' , -- FParentKey - varchar(50)
0 , -- FConditionExt - int
2 , -- FFrameBorder - int
0 , -- FFrameBorderColor - int
0 , -- FLabelWidth - smallint
0 , -- FLabelColor - int
0 , -- FTextColor - int
0 , -- FIsF7 - smallint
'' , -- FContainer - nvarchar(60)
0 -- FStyle - int
)
请总部老师尽快给予支持和解决。谢谢!
推荐阅读