从k3V10.3升级到k3wise14.2报错
金蝶云社区-云社区用户inH36820
云社区用户inH36820
0人赞赏了该文章 1,414次浏览 未经作者许可,禁止转载编辑于2016年07月19日 11:48:40

从k3V10.3升级到k3wise14.2报错,现在在14.2里面查询生产任务单一笔都没有,成本模块也没数据
如下是报错内容,麻烦总部看下是什么问题,怎么修改
执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP04_K3V10.3OPCostData.sql出错。
错误描述:违反了 UNIQUE KEY 约束 'uk_ItemClass'。不能在对象 'dbo.t_ItemClass' 中插入重复键。
错误语句:
--[NO SQL FILE INFOMATION]
IF NOT EXISTS( SELECT 1 FROM t_ItemClass WHERE FItemClassID = 2030)
BEGIN
INSERT INTO t_ItemClass(FItemClassID,FNumber,FName,FSQLTableName,FVersion,FImport,FBrNo,FUserDefilast,FName_Cht,FName_en)
VALUES (2030,'2030','成本中心','t_BASE_CostCenter',0,0,'0',100,'成本中心','Cost Center')
EXECUTE p_Base_AddItemAuthority 2030 --增加权限数据(通过存储过程执行)
END

执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP04_K3V10.3OPCostData.sql出错。
错误描述:INSERT 语句与 FOREIGN KEY 约束"FK_FItemClassID"冲突。该冲突发生于数据库"AIS20070213165737",表"dbo.t_ItemClass", column 'FItemClassID'。
错误语句:
--[NO SQL FILE INFOMATION]
DECLARE @FItemID INT --增加成本中心的预设数据
IF NOT EXISTS(SELECT 1 FROM t_Item WHERE FItemClassID = 2030 AND FNumber = 'NON_OPERATIONTRACKID')
BEGIN
INSERT INTO t_Item(FItemClassID,FNumber,FName,FDetail,FLevel,FParentID)
VALUES(2030,'NON_OPERATIONTRACKID','非工序跟踪成本中心',1,1,0)
SELECT @FItemID = FItemID FROM t_Item WHERE FItemClassID = 2030 AND FNumber = 'NON_OPERATIONTRACKID'
INSERT INTO t_BASE_CostCenter (FItemID,FNumber,FName,FAcctID,FDeptID,FRemark)
VALUES(@FItemID,'NON_OPERATIONTRACKID','非工序跟踪成本中心',0,0,'此成本中心仅适用非工序跟踪生产任务单生成凭证时使用。')
END

执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP04_K3V10.3OPCostData.sql出错。
错误描述:对象名 'Access_t_BASE_CostCenter' 无效。
错误语句:
--[NO SQL FILE INFOMATION]
DECLARE @SQL NVARCHAR(4000)
DECLARE @ACCTTYPE NVARCHAR(20)
SELECT @ACCTTYPE = FValue FROM t_SystemProfile WHERE FCategory = 'Base' AND FKey = 'AcctType'
SET @SQL ='CREATE VIEW Access_t_Item
AS
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_cbCostItem
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_cbCostObj
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_cbCostObjGroup
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_cbExpense
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_cbService
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_Department
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_Emp
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_Fee
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_ICItem
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_Item9
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_Organization
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_SonCompany
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_Stock
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_Supplier
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_WorkCenter
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_BASE_Area
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_BASE_CityPort
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_BASE_HSCode
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_T_BASE_InsuranceType
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_BASE_CostCenter
UNION
SELECT FItemIDY AS FItemID,FParentIDY AS FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_gr_framework'
IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE NAME ='Access_t_ItemDefine' AND XTYPE ='U')
BEGIN
SET @SQL = @SQL + '
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_ItemDefine'
END
IF UPPER(@ACCTTYPE)<>'ZFKJ'
BEGIN
SET @SQL =@SQL + '
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_BK_Acnt
UNION
SELECT FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete FROM Access_t_scPlanItem'
END
EXECUTE(@SQL)
SET @SQL =''

执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP_K3V12.0BASEData.sql出错。
错误描述:违反了 UNIQUE KEY 约束 'uk_ItemClass'。不能在对象 'dbo.t_ItemClass' 中插入重复键。
错误语句:
--TEAM=BASE,DBA=shichan_wang,PM=wsq,DC=xuying,TEL=8663
IF NOT EXISTS( SELECT 1 FROM t_ItemClass WHERE FItemClassID = 2030)
BEGIN
INSERT INTO t_ItemClass(FItemClassID,FNumber,FName,FSQLTableName,FVersion,FImport,FBrNo,FUserDefilast,FName_Cht,FName_en)
VALUES (2030,'2030','成本中心','t_BASE_CostCenter',0,0,'0',100,'成本中心','Cost Center')
EXECUTE p_Base_AddItemAuthority 2030 --增加权限数据(通过存储过程执行)
END

执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP_K3V12.0BASEData.sql出错。
错误描述:INSERT 语句与 FOREIGN KEY 约束"FK_FItemClassID"冲突。该冲突发生于数据库"AIS20070213165737",表"dbo.t_ItemClass", column 'FItemClassID'。
错误语句:
--TEAM=BASE,DBA=shichan_wang,PM=wsq,DC=xuying,TEL=8663
DECLARE @FItemID INT --增加成本中心的预设数据
IF NOT EXISTS(SELECT 1 FROM t_Item WHERE FItemClassID = 2030 AND FNumber = 'NON_OPERATIONTRACKID')
BEGIN
INSERT INTO t_Item(FItemClassID,FNumber,FName,FDetail,FLevel,FParentID)
VALUES(2030,'NON_OPERATIONTRACKID','非工序跟踪成本中心',1,1,0)
SELECT @FItemID = FItemID FROM t_Item WHERE FItemClassID = 2030 AND FNumber = 'NON_OPERATIONTRACKID'
INSERT INTO t_BASE_CostCenter (FItemID,FNumber,FName,FAcctID,FDeptID,FRemark)
VALUES(@FItemID,'NON_OPERATIONTRACKID','非工序跟踪成本中心',0,0,'此成本中心仅适用非工序跟踪生产任务单生成凭证时使用。')
END

执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP_K3V12.0OPCOSTData.sql出错。
错误描述:INSERT 语句与 FOREIGN KEY 约束"FK_FItemClassID"冲突。该冲突发生于数据库"AIS20070213165737",表"dbo.t_ItemClass", column 'FItemClassID'。
错误语句:
--TEAM=COST,DBA=kevin_yu,PM=seven,DC=weixy,TEL=8311
--找出没有设“非工序跟踪成本中心”类型的车间部门并设置对应的非工序跟踪类型的成本中心
DECLARE @TEMPDeptTable TABLE (FID INT IDENTITY(1,1),FNumber NVARCHAR(510),FName NVARCHAR(510),FDeptID INT)
DECLARE @sNumber NVARCHAR(510)
DECLARE @sName NVARCHAR(510)
DECLARE @FDeptID INT
DECLARE @FItemID INT
DECLARE @FID INT
SELECT @FID=1
INSERT INTO @TEMPDeptTable(FNumber,FName,FDeptID)
SELECT t1.FNumber,t1.FName,t1.FItemID FROM t_Department t1
LEFT JOIN t_BASE_CostCenter t2 ON t1.FItemID=t2.FDeptID AND t2.FCCType=14153
WHERE t1.FDProperty=1070 AND t2.FDeptID IS NULL
WHILE @@ROWCOUNT>0
BEGIN
SELECT @FID=FID,@sNumber=FNumber,@sName=FName,@FDeptID=FDeptID FROM @TEMPDeptTable WHERE FID=@FID
SELECT @FID=@FID+1
IF NOT EXISTS(SELECT 1 FROM t_Item WHERE FItemClassID = 2030 AND FNumber = @sNumber + '_NON_OPERATIONTRACK')
BEGIN
INSERT INTO t_Item(FItemClassID,FNumber,FName,FDetail,FLevel,FParentID)
VALUES(2030,@sNumber + '_NON_OPERATIONTRACK',@sName + '_NON_OPERATIONTRACK',1,1,0)
SELECT @FItemID = FItemID FROM t_Item WHERE FItemClassID = 2030 AND FNumber = @sNumber + '_NON_OPERATIONTRACK'
INSERT INTO t_BASE_CostCenter (FItemID,FNumber,FName,FAcctID,FDeptID,FCCType)
VALUES(@FItemID,@sNumber + '_NON_OPERATIONTRACK',@sName + '_NON_OPERATIONTRACK',0,@FDeptID,14153)

DELETE FROM Access_t_BASE_CostCenter WHERE FItemID=@FItemID
INSERT INTO Access_t_BASE_CostCenter(FItemID,FParentIDX,FDataAccessView,FDataAccessEdit,FDataAccessDelete)
VALUES(@FItemID,0,CONVERT(VARBINARY(7200),REPLICATE(CHAR(255),100)),CONVERT(VARBINARY(7200),REPLICATE(CHAR(255),100)),CONVERT(VARBINARY(7200),REPLICATE(CHAR(255),100)))

SELECT FID,FNumber,FName FROM @TEMPDeptTable WHERE FID=@FID
END
END

执行文件D:\PROGRAM FILES\KINGDEE\K3ERP\KDSYSTEM\KDCOM\SqlSrv\SP_KSEV12.1GLData.sql出错。
错误描述:因为发现对象名称 'dbo.T_CFInfo_10' 和索引名称 'PK_T_CFInfo_10' 有重复的键,所以 CREATE UNIQUE INDEX 语句终止。重复的键值为 (1, 现字, 129, 01 28 2014 12:00AM)。
错误语句:
--TEAM=FIN,DBA=e_chen,PM=Fence_Xiong,DC=guoren_lin,TEL=8661
--Begin add by yuzhao 2009-09-23
--同步K/3_10.3.0_现金流量表_全局(PT026376)_现金流量表凭证提取不全
--对老帐套升级到新帐套时,修改T_CFAnal_*和T_CFInfo_*的主键,增加FDate
IF Exists(select 1 from T_CFSet)
--升级账套
SET NOCOUNT ON
DECLARE @FTransInfoTable varchar(20)
DECLARE @pkFTransInfoTable varchar(20)
DECLARE @FTransedTable varchar(20)
DECLARE @pkFTransedTable varchar(20)
declare @sql nvarchar (1000)
declare @count int
--获取老帐套中现金流量表存在的所有方案
DECLARE cf_cursor CURSOR FOR
select rtrim(ltrim(FTransInfoTable)),rtrim(ltrim(FTransedTable)) from t_cfset
OPEN cf_cursor
FETCH NEXT FROM cf_cursor
INTO @FTransInfoTable,@FTransedTable
WHILE @@FETCH_STATUS = 0
BEGIN
--不允许FDate为空
set @sql='alter table ' + @FTransInfoTable + ' alter column FDate datetime not null'
exec sp_executesql @sql
--删除
set @pkFTransInfoTable='pk_' + @FTransInfoTable
set @sql='select @count=count(1) from sysobjects where name like ''' + @pkFTransInfoTable + ''''
--print @sql
exec sp_executesql @sql,N'@count int out',@count out
if @count<>0
begin
set @sql='ALTER TABLE ' + @FTransInfoTable + ' DROP CONSTRAINT PK_' + @FTransInfoTable
exec sp_executesql @sql
end
--增加
set @sql='ALTER TABLE ' + @FTransInfoTable + ' ADD CONSTRAINT PK_' + @FTransInfoTable + ' PRIMARY KEY CLUSTERED (Fperiod,FGroup,FNum,FDate) ON [PRIMARY]'
exec sp_executesql @sql
--------------------------
--不允许FDate为空
set @sql='alter table ' + @FTransedTable + ' alter column FDate datetime not null'
exec sp_executesql @sql
--删除
set @pkFTransedTable='pk_' + @FTransedTable
set @sql='select @count=count(1) from sysobjects where name like ''' + @pkFTransedTable + ''''
exec sp_executesql @sql,N'@count int out',@count out
if @count<>0
begin
set @sql='ALTER TABLE ' + @FTransedTable + ' DROP CONSTRAINT PK_' + @FTransedTable
exec sp_executesql @sql
end
--增加
set @sql='ALTER TABLE ' + @FTransedTable +' ADD CONSTRAINT PK_' + @FTransedTable + ' PRIMARY KEY CLUSTERED (FPeriod,FGroup,FNum,FEntryID,FDate)ON [PRIMARY]'
--print @sql
exec sp_executesql @sql
FETCH NEXT FROM cf_cursor
INTO @FTransInfoTable, @FTransedTable
END
CLOSE cf_cursor
DEALLOCATE cf_cursor