在数据库执行下语句
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
金蝶财务软件技术服务: 周 18523974565(微信) QQ:2795853531