北京用友北京用友

您所在的位置:首页 -> 常见问题 -> 用友T3常见问题
用友T3记账时提示“运行时错误:违反了primary key 约束'gl_mpostcond1_pk',不能在对象束'gl_mpostcond1'中插入重复键”
浏览:969次 评论:0条 发表日期:2020-05-30 18:25:54作者:
Tags:gl_mpostcond1_pk
问题现象:用友T3记账时提示“运行时错误:违反了primary key 约束'gl_mpostcond1_pk',不能在对象束'gl_mpostcond1'中插入重复键”。大多数是用友T310.8左右的版本的产品。通过手动删除gl_mpostcond1记录后,反记账后仍然出现此类问题。
问题解决:
总帐记帐时提示这个报错
处理方法:清空 gl_mpostcond1
代码:delete  gl_mpostcond1
清除后可以记帐,但是在反记后在去记帐还是报这样的错误

处理方法:找到演示帐套的存储过程 GL_P_JZFA所有任务-生成SQL脚本。
然后在出现问题的帐套找到这个存储过程,然后删除.找到刚才生成的脚本在当前的帐套年度生成下就可以了。
如果这样还不行。就把存储过程中GL_P的中带JZ的都删除。从999中生成脚本然后在执行,这样绝对可以解决。
 

--记账时提示“运行时错误:违反了primary key 约束'
SET QUOTED_IDENTIFIER OFF 
go
SET ANSI_NULLS ON
go
ALTER Proc [dbo].[GL_P_JZA](@iPer tinyint = 11, @ccash tinyint =1, @tcond varchar(5000)= '') AS SET NOCOUNT On declare @ss varchar(8000)  declare @Checkflag varchar(20) declare @trnd bigint set @trnd=(select convert(bigint,rand()*100000000000)) declare @temptable varchar(50) declare @temptable2 varchar(50) set @temptable='GL_jztmp'+ convert(varchar(30),@trnd) set @temptable2='gl_bookB'+ convert(varchar(30),@trnd) set @Checkflag = (SELECT cvalue FROM AccInformation WHERE cSysID='GL' AND cName='bNotCheckJz') Delete From GL_mpostcond1 if @ccash=0 begin if @Checkflag = 'False' set @ss='SELECT iperiod,isignseq,ino_id From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0) +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (not (ccheck is null) and iflag is null or ccheck is null and iflag=1) GROUP BY iperiod,isignseq,ino_id' else set @ss='SELECT iperiod,isignseq,ino_id From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0) +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (iflag is null or ccheck is null and iflag=1) GROUP BY iperiod,isignseq,ino_id' Insert GL_mpostcond1 exec (@ss) End Else begin if not object_id('tempdb..'+@temptable) is null exec('drop table tempdb..'+ @temptable) if @Checkflag = 'False' set @ss='SELECT isignseq,ino_id,1 as zt into tempdb..'+@temptable+' FROM gl_accvouch inner join code ON gl_accvouch.ccode = code.ccode where ibook=0 and iperiod= '+convert(char,@iPer,0)+(case when @tcond='' then '' else ' and (' + @tcond + ')' end) +' and ((code.bbank ^ code.bcash) =1) and ((not (ccheck is null)) and (ccashier is null)) GROUP BY isignseq,ino_id Union SELECT isignseq,ino_id,0 as zt From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0) +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (not (ccheck is null) and iflag is null or ccheck is null and iflag=1) GROUP BY isignseq,ino_id' else set @ss='SELECT isignseq,ino_id,1 as zt into tempdb..'+@temptable+' FROM gl_accvouch inner join code ON gl_accvouch.ccode = code.ccode where ibook=0 and iperiod= '+convert(char,@iPer,0)+(case when @tcond='' then '' else ' and (' + @tcond + ')' end) +' and ((code.bbank ^ code.bcash) =1) and (ccashier is null) GROUP BY isignseq,ino_id Union SELECT isignseq,ino_id,0 as zt From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0) +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (iflag is null or ccheck is null and iflag=1) GROUP BY isignseq,ino_id'  exec (@ss) exec('SELECT isignseq,ino_id,sum(zt) as zt1 into tempdb..' + @temptable2 + ' from tempdb..'+@temptable+' group by isignseq,ino_id') set @ss='select '+convert(char,@iPer,0)+' as iperiod,isignseq,ino_id from tempdb..' + @temptable2 + ' Where zt1 = 0 '+(case when @tcond='' then '' else ' and (' + @tcond + ')' end) insert GL_mpostcond1 exec (@ss) if not object_id('tempdb..'+@temptable2) is null exec('drop table tempdb..'+ @temptable2) End 
go
上一篇用友通 T3 中输入用户名和密码之..
下一篇T3总账和明细对不上

最新文章

忘记SA口令,如果不想修改密码如何找回SA呢
用友软件打印凭证提示“打印错误-107”
用友T3标准版已停止工作
T3和系统管理图标变成了白色无图标
T3软件打开是乱码"???"怎么回事
用友U8软件3265在对应所需名称或序数的集合中,未找
最新图文教程

北京用友远程维护收

忘记SA口令,如果不

用友软件打印凭证提

用友T3标准版已停止

T3和系统管理图标变

T3软件打开是乱码&qu

用友U8软件3265在对

用友U8 无法打开登陆

热门文章

[10-26]
[10-08]
[09-15]
[04-02]
[03-03]
[10-18]

推荐文章

相关文章

在线咨询
售后支持
  • 业务电话:010-84986180
  • 13720089039
  • 夜间值班:18910108696
  • 北京会计QQ群:6388368