1、凭证过账时系统提示:名称或代码在系统中已经被使用错误代码:3604(E14H)Source:MicrosoftOLEDBProviderforSQLServerDetail:在结果列的列表中多次出现列名'F8'执行语句校正即可updatedsetd.fdetailcount=v.fcountfromt_ItemDetaild,(selectfdetailid,count(*)fcountfromt_ItemDetailvwherefitemid=-1groupbyfdetailid)vwhered.fdetailid=v.fdetailid不同的账套,可能会提示不同的列名,如F1等,请变通执行错误原因:核算项目横表t_itemdetail的核算项目类别数目和科目挂的核算项目数目不一致2、在查询科目余额表并选择包括核算项目时,系统提示:名称或代码在系统中已被使用错误代码:3604(E14H)Fdetail:列名'F3001'无效补回此列,如果有数据发生还要补回数据IfNotExists(Selectc.Namefromsyscolumnsc,sysobjectsowherec.Id=o.Idandc.name='F3001'ando.name='t_ItemDetail')BeginAlterTablet_ItemDetailAddF3001intnotnulldefault(0)CreateIndexix_ItemDetail_3001Ont_ItemDetail(F3001)END如果还存在其他列名无效,参照修改上述SQL中的列名后,进行添加。错误原因:在t_itemdetail表中缺少列F30013、录入凭证时提示错误代码:3604(E14H),Source:MicrosoftOLEDBProviderforSQLServerDetail:分布式事务已完成。请将此会话登记到新事务或NULL事务中此问题是由凭证最大内码号超过2147483647造成的,请参考以下SQL处理selectdistinct(fvoucherid)ASFoldid,IDENTITY(int,1,1)asfnewidinto#tmpafromt_voucher----建立新旧凭证内码对应关系updateaseta.fvoucherid=b.fnewidfromt_vouchera,#tmpabwherea.fvoucherid=b.folded-----用新内码替换旧内码updateaseta.fvoucherid=b.fnewidfromt_voucherentrya,#tmpabwherea.fvoucherid=b.foldidupdatet_identitysetfnext=(selectmax(fvoucherid)fromt_voucher)+1wherefname='t_voucher'凭证无法过账、账薄报表无法查询、无法结转损益结转损益之后无法过帐或仍有余额,提示:在结果列中多次出现F1,名称或代码已存在等一般是fdetailcount数目不对或者相同的核算项目组合出现重复,对于错误fdetailcount,首先要执行如下语句进行更新:execsp_cleanitemdetailv--横表生成纵表的存储结构updateaseta.fdetailcount=b.Fcountfromt_itemdetailajoin(selectFdetailid,count(Fitemid)Fcountfromt_itemdetailvwherefitemid0groupbyFdetailid)bona.fdetailid=b.fdetailid--更新fdetailcountexecsp_cleanitemdetailv--重新生成纵表作了以上更新后发现表中还存在相同组合的重复记录,这是不允许的:而我们只需要保留一个fdetailid即可,此时我们取最小的fdetailid,执行如下语句更新科目表:updatet_accountsetFdetailid=(selectmin(fdetailid)fromt_itemdetailwherefdetailidin(selectFdetailidfromt_itemdetailvwherefitemid=-1)andFdetailcount=1andF2=-1)whereFdetailidin(select(fdetailid)fromt_itemdetailwherefdetailidin(selectFdetailidfromt_itemdetailvwherefitemid=-1)andFdetailcount=1andF2=-1)同时我们还要删除核算项目横表中的多余记录,执行如下语句:deletefromt_itemdetailwhereFdetailidin(select(fdetailid)fromt_itemdetailwherefdetailidin(selectFdetailidfromt_itemdetailvwherefitemid=-1)andFdetailcount=1andF2=-1)andFdetailid(selectmin(fdetailid)fromt_itemdetailwherefdetailidin(selectFdetailidfromt_itemdetailvwherefitemid=-1)andFdetailcount=1andF2=-1)execsp_cleanitemdetailv--重新生成纵表另外还要查看各余额表中有没有非法的fdetailid,即不在核算项目横纵表中的,有的话则需要删除:--查找科目余额表中有没有非法的fdetailidselect*fromt_balancewherefdetailidnotin(selectfdetailidfromt_itemdetail)--删除科目余额表中非法的fdetailiddeletefromt_balancewherefdetailidnotin(selectfdetailidfromt_itemdetail)同理进行以下操作查找数量余额表中有没有非法的fdetailidselect*fromt_quantitybalancewherefdetailidnotin(selectfdetailidfromt_itemdetail)删除数量余额表中非法的fdetailiddeletefromt_quantitybalancewherefdetailidnotin(selectfdetailidfromt_itemdetail)查找损益类科目实际发生额表中有没有非法的fdetailidselect*fromt_profitandlosswherefdetailidnotin(selectfdetailidfromt_itemdetail)删除损益类科目实际发生额表中有没有非法的fdetailiddeletefromt_profitandlosswherefdetailidnotin(selectfdetailidfromt_itemdetail)根据F列进行变通,可以通过下面的语句查查select*fromt_itemdetailwherefdetailidin(selectfdetailidfromt_itemdetailvwherefitemid=-1)