找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

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

[求助] T3普及版记账时提示运行时错误

[复制链接]
发表于 2015-7-17 12:08:49 | 显示全部楼层 |阅读模式

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

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

×
T3普及版记账时提示:运行时错误‘-2147217873(80040e2f)':违反了PRIMMARY KEY 约束‘GL-mpostcond1_pk"不能在对象‘GL-Mpostcond1中键入重复键。有解决的办法和工具么?
QQ截图20150706164627.png
发表于 2015-7-17 14:32:03 | 显示全部楼层
这个高发问题嘛,支持网有解决办法!
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-17 14:38:30 | 显示全部楼层
一、如果是用友T310.8plus1之前的版本,请先在查询分析器中执行如下脚本:
use ufdata_xxx_2014
delete from gl_mpostcond1
然后再执行如下脚本,避免后续出现类似的问题。
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
二、如果是用友T310.8plus1之后的版本,包括用友T310.8plus1普及版和标准版请直接安装最新的补丁就行了。

点评

高手学习了,为您点个大赞  详情 回复 发表于 2015-7-17 16:58
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-17 14:41:50 | 显示全部楼层
楼上高能!
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-17 14:48:34 | 显示全部楼层
路过学学下
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-17 16:54:29 | 显示全部楼层
学习了,我记得论坛有个什么执行语句的SQL脚本软件,执行一下就可以了
回复 点赞 拍砖

使用道具 举报

 楼主| 发表于 2015-7-17 16:58:19 | 显示全部楼层
半度空间 发表于 2015-7-17 14:38
一、如果是用友T310.8plus1之前的版本,请先在查询分析器中执行如下脚本:
use ufdata_xxx_2014
delete f ...

高手学习了,为您点个大赞
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-17 23:32:18 | 显示全部楼层
此类情况一般是客户按照正常的账套备份方式做了备份,我们看一下正常情况下做的账套备份:
   1.正常备份:通过系统管理,账套菜单,输出账套,备份后有两个文件:UFDATA.BA_和UfErpAct.Lst
      恢复方法:打系统管理,账套菜单,恢复,选择要恢复的文件,点击确定。
   2.物理备份:由于用友软件已经出现问题,无法进入系统管理,而我们又需要重装软件,那么我们就需要进行物理备份,正常情况下需要备份以下文件:
      安装目录下admin\ztXXX(账套)\20XX(年度)\ufdata.mdf和ufdata.ldf
      安装目录下admin\UFSystem.MDF、UFSystem.LDF

点评

你这个回答和楼主的问题毫无关系嘛!  详情 回复 发表于 2015-7-18 10:43
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-18 10:43:01 | 显示全部楼层
fhbgc001 发表于 2015-7-17 23:32
此类情况一般是客户按照正常的账套备份方式做了备份,我们看一下正常情况下做的账套备份:
   1.正常备份:通 ...

你这个回答和楼主的问题毫无关系嘛!
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-18 19:12:24 | 显示全部楼层
8楼的回答跟楼主的问题不相关哈,

点评

先反过账至本月月初状态,然后再重新记账。  详情 回复 发表于 2015-7-19 10:22
回复 点赞 拍砖

使用道具 举报

发表于 2015-7-19 10:22:32 | 显示全部楼层
nazi8888 发表于 2015-7-18 19:12
8楼的回答跟楼主的问题不相关哈,

先反过账至本月月初状态,然后再重新记账。
回复 点赞 拍砖

使用道具 举报

发表于 2016-4-7 11:42:12 | 显示全部楼层
10.8plus1标准版出现这问题,用LZ的语句执行了下,亲测,搞定了!
回复 点赞 拍砖

使用道具 举报

发表于 2016-8-5 17:00:36 | 显示全部楼层
谢谢LZ无私的贡献!
回复 点赞 拍砖

使用道具 举报

发表于 2017-4-15 09:08:48 | 显示全部楼层
打开数据库,找到出现错误的账套,点击找到表GL-mpostcond1,打开返回所有行后,将里面的所有东西都删了。重新登录记账就可以了。
回复 点赞 拍砖

使用道具 举报

发表于 2017-4-17 10:54:04 | 显示全部楼层
手学习了,为您点个大赞
回复 点赞 拍砖

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-29 10:57 , Processed in 0.050265 second(s), 14 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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