解决方案: |
该BUG开发已在2004-6-4提供了补丁。请将支持网站U851A固定资产最新补丁(补丁编号:1294)打上去以避免今后出现类似错误。针对目前已经出现的问题,可在当前帐套年度库中通过参照执行如下脚本进行修复(只限单部门使用时): (注意如果当前月份不是8月份,需要在以下脚本中的“[iObjectNum] = 8”条件改成对应的月份即可) 步骤1、 DELETE from fa_DeptScale WHERE lOptID IN (select loptid from fa_EvaluateMain) -------------------------------------------- if exists(select * from sysobjects where id = object_id(N'[dbo].[fa_DeptScale_Temp0]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[fa_DeptScale_Temp0] --GO CREATE TABLE fa_DeptScale_Temp0 ( [sID] [int] IDENTITY (1, 1) NOT NULL , [sCardNum] [varchar] (5) NOT NULL , [lOptID] [int] NOT NULL , [sDeptNum] [varchar] (12) NOT NULL , [dblScale] [float] NOT NULL , [sDeprSubjectNum] [varchar] (20) NULL , [sDeprSubjectName] [varchar] (50) NULL , [sProjectNum] [varchar] (20) NULL , [sProjectName] [varchar] (50) NULL ) ON [PRIMARY] 步骤2、 INSERT INTO fa_DeptScale_Temp0([sCardNum], [lOptID], [sDeptNum], [dblScale], [sDeprSubjectNum], [sDeprSubjectName],[sProjectNum],[sProjectName]) SELECT fa_Cards.sCardNum, fa_Cards.lOptID, fa_Cards.sDeptNum, 1, NULL, NULL,NULL,NULL from fa_Cards WHERE lOptID IN (select loptid from fa_EvaluateMain) 步骤3、 update fa_Objects set [lMaxID] = (select max(sid) from fa_DeptScale where len(sid)>3) where [iObjectNum] = 8 步骤4、 declare @iNO INT SELECT @iNO = [lMaxID] FROM fa_Objects where [iObjectNum] = 8 INSERT INTO [fa_DeptScale]([sID], [sCardNum], [lOptID], [sDeptNum], [dblScale], [sDeprSubjectNum], [sDeprSubjectName],[sProjectNum],[sProjectName]) select [sID] + @iNO, [sCardNum], [lOptID], [sDeptNum], [dblScale], [sDeprSubjectNum], [sDeprSubjectName],[sProjectNum],[sProjectName] from fa_DeptScale_Temp0 update fa_Objects set [lMaxID] = @iNO + @@rowCount where [iObjectNum] = 8 drop table [dbo].[fa_DeptScale_Temp0] 注意做好数据备份! |