畅捷通T+升级报错:对象名称 'dbo.GL_ReferenceDocClass' 和索引名称 'ix_code' 有重复的键

畅捷通T+升级报错:对象名称 'dbo.GL_ReferenceDocClass' 和索引名称 'ix_code' 有重复的键

问题现象:用友畅捷通T+财务软件升级报错,具体提示如下:因为发现对象名称 'dbo.GL_ReferenceDocClass' 和索引名称 'ix_code' 有重复的键,

重复数据问题SQL 脚本: 11.510.000.0000 DATA_DSTR_FI_Vou_NL.sql 出错:因为发现对象名称 'dbo.GL_ReferenceDocClass' 和索引名称 'ix_code' 有重复的键,所以 CREATE UNIQUE INDEX 语句终止。重复的键值为 (01)。语句已终止。

解决办法:根据重复的键值,找到重复的记录,然后删除(操作前请备份好您用友T+财务软件中的数据,可参考教程:http://www.ufidawhy.com/jcufida/1389.html),示例语句如下:

if((select COUNT(code) from GL_ReferenceDocClass where code ='01')>1)

begin

delete from GL_ReferenceDocClass where code ='01' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='01')

end

if((select COUNT(code) from GL_ReferenceDocClass where code ='02')>1)

begin

delete from GL_ReferenceDocClass where code ='02' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='02')

end

if((select COUNT(code) from GL_ReferenceDocClass where code ='03')>1)

begin

delete from GL_ReferenceDocClass where code ='03' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='03')

end

if((select COUNT(code) from GL_ReferenceDocClass where code ='04')>1)

begin

delete from GL_ReferenceDocClass where code ='04' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='04')

end

if((select COUNT(code) from GL_ReferenceDocClass where code ='05')>1)

begin

delete from GL_ReferenceDocClass where code ='05' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='05')

end

if((select COUNT(code) from GL_ReferenceDocClass where code ='06')>1)

begin

delete from GL_ReferenceDocClass where code ='06' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='06')

end

if((select COUNT(code) from GL_ReferenceDocClass where code ='07')>1)

begin

delete from GL_ReferenceDocClass where code ='07' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='07')

end

if((select COUNT(code) from GL_ReferenceDocClass where code ='08')>1)

begin

delete from GL_ReferenceDocClass where code ='08' and ts in

(select top 1 ts from GL_ReferenceDocClass where code ='08')

end

点击这里复制本文地址 以上内容由 用友erp软件免费下载 收集自互联网,如有侵权请联系删除!
qrcode

用友财务软件免费下载_用友软件免费下载_用友财务软件 © All Rights Reserved.  
(www.yyrjxz.com)用友财务软件免费下载网站为广大用友软件爱好者提供免费的用友软件资源,我们专注于用友财务软件免费版用友财务软件试用版、并提供用友软件官网包括用友T1进销存用友T3畅捷通T+用友T6用友U8电算化等财务软件免费下载地址,免费提供用友软件免费版,用友财务软件教程等非常全面的用友财务软件免费资源!

copyright © 2013-2015 yyrjxz . Design By 用友软件 版权所有
赣ICP备13006939号