10.0行政事业账套,在自动对账时发现期初余额差额刚好是固定资产初始化期间的合计数,检查数据库发现t_FABalance表中缺少初始化期间的数据,写下列SQL脚本补上t_FABalance表中初始化数据:
insert into t_FABalance(fassetid,fyear,fperiod,fdate,fnump,fdeprperiods,forgvalp,FYtdDeprDec,FYtdDeprInc,FYtdOrgValDec,
FYtdOrgValInc,FDepr,FDeprShould,FAccumDeprDec,FAccumDeprInc,FAccumDeprP,FNumAlter,FOrgValDec,FOrgValInc,
FWorkload,FCleared)
select a.fassetid ,a.fyear ,a.fperiod+1,a.fdate ,b.fnum ,b.fperiodsused ,b.FOrgVal,0,0,0,0,0,0,0,0,0,0,0,0,0,0
from t_FAAlter as a,t_FACard as b
where a.fperiod=0 and b.FAlterID =a.falterid
但提示:不能在具有唯一索引 'UI_t_FABalance' 的对象 't_FABalance' 中插入重复键的行。
语句已终止。
t_FABalance表中有三个索引字段分别为fassetid,fyear,fperiod,其中fassetid是不分重复的,只有fyear,fperiod是重复的,这个错误提示是不是就是说fyear,fperiod两个字段有重复的值?该如何处理?谢谢!