select * from t_itemdetail
exec sp_cleanitemdetailv
GO
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
凭证过账时系统提示:名称或代码在系统中已经被使用 错误代码:3604(E14H) Source :Microsoft OLE DB Provider for SQL Server Detail :在结果列的列表中多次出现列名 'F8'
update d set d.fdetailcount=v.fcount
from t_ItemDetail d,
(select fdetailid,count(*) fcount from t_ItemDetailv where fitemid=-1 group by fdetailid ) v
where d.fdetailid=v.fdetailid
不同的账套,可能会提示不同的列名,如F1等,请变通执行
在查询科目余额表并选择包括核算项目时,系统提示:
名称或代码在系统中已被使用
错误代码:3604(E14H)
Fdetail:列名'F3001'无效
If Not Exists(Select c.Name from syscolumns c,sysobjects o
where c.Id=o.Id and c.name='F3001' and o.name='t_ItemDetail')
Begin
Alter Table t_ItemDetail Add F3001 int not null default(0)
Create Index ix_ItemDetail_3001 On t_ItemDetail(F3001)
END
如果还存在其他列名无效,参照修改上述SQL中的列名后,进行添加。