找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
查看: 5483|回复: 11

[技巧] 运行时错误‘-2147217873(80040e2f)

[复制链接]
发表于 2017-1-23 14:57:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
又是记账的时候发现的错误,老的T3 10.8PLUS普及版的 用友T3财务软件在记账的时候提示错误:运行时错误‘-2147217873(80040e2f)':违反了PRIMMARY KEY 约束‘GL-mpostcond1_pk"不能在对象‘GL-Mpostcond1中键入重复键
网上有卖工具的,其实用查询分析器就可以解决
1.如果是用友T310.8plus1之前的版本,请先在查询分析器中执行如下脚本:

use ufdata_xxx_2014

delete from gl_mpostcond1
2.查询分析器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      
SET QUOTED_IDENTIFIER OFF      
GO      
SET ANSI_NULLS ON      
GO
搞定
发表于 2017-1-23 15:48:26 | 显示全部楼层
xue xi le
回复 点赞 拍砖

使用道具 举报

发表于 2017-1-23 19:33:12 | 显示全部楼层
没看懂。。。
回复 点赞 拍砖

使用道具 举报

发表于 2017-1-23 20:25:55 | 显示全部楼层
简单问题让你搞得很复杂,说的很多,,
回复 点赞 拍砖

使用道具 举报

发表于 2017-1-25 08:39:42 | 显示全部楼层
路过看看 学习一下
回复 点赞 拍砖

使用道具 举报

发表于 2017-2-19 10:45:24 | 显示全部楼层
打上官网补丁就能解决这个问题了!
回复 点赞 拍砖

使用道具 举报

发表于 2018-2-12 11:27:09 | 显示全部楼层
补丁打到多少
回复 点赞 拍砖

使用道具 举报

发表于 2018-2-13 18:25:16 | 显示全部楼层
10.8PLUS1会出现这样的问题,最好是打官网补丁解决!
回复 点赞 拍砖

使用道具 举报

发表于 2018-2-28 23:05:16 | 显示全部楼层
补丁下载后不能更新呀
回复 点赞 拍砖

使用道具 举报

发表于 2018-3-1 16:38:27 | 显示全部楼层
试一下计算机名和时间格式
回复 点赞 拍砖

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-4-18 18:18 , Processed in 0.044182 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表