用友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+财务软件中的数据,可参考教程:https://www.ufidaft.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
相关文章
- 拼多多店铺财务软件是什么 拼多多店铺财务软件:小微商家必备,惊喜功能简化管理!
- 用友财务软件凭证漏号怎么办 用友财务软件凭证漏号解决方法#高效解决指南_新手必看
- 财务软件建账往来初始余额是什么 轻松搞定财务难题 真相竟如此简单!
- 适合工地做账的财务软件推荐 提升财务效率与资金流管理
- 财务经营管理黄晓明:风险规避技巧与企业经营策略全面解读
- 用友t3账套库系统库恢复 用友T3账套库系统库恢复 数据安全与备份最新策略技巧全面解析
- 会计实务是干嘛 初级会计必看 实战技巧全揭秘 真实案例快速上手
- 企业财务预算套表:方法推荐与组成部分全面解析
- 小型装修财务软件有哪些好用 从小白到高手:小型装修企业必备的高效财务软件管理工具
- 平台收取手续费会计分录 竟然这么简单!90%的会计却做错了~