常见原因是核算项目横表中核算项目个数与 F 列不对应导致的,可通过以下语
句进行修复(直接在查询分析器针对问题账套执行即可),
select * from t_itemdetail
exec sp_cleanitemdetailvGO
update a set a.fdetailcount=b.Fcount
from t_itemdetail a join (select Fdetailid,count(*) as Fcount from t_itemdetailv
where fitemid=-1 group by Fdetailid) b
on a.fdetailid=b.fdetailid where a.fdetailcount<>b.Fcount