发现对象名称 'dbo.EAP_VoucherDraft' 和索引名称 'pk_EAP_VoucherDraft' 有重复的键
问题现象:用友畅捷通T+财务软件升级报错,具体提示如下:脚本: 11.600.000.0000 DATA_DATA_RAP_NL 出错:因为发现对象名称 'dbo.EAP_VoucherDraft' 和索引名称 'pk_EAP_VoucherDraft' 有重复的键,所以 CREATE UNIQUE INDEX 语句终止。重复的键值为 (21fdb25a-952b-f9a0-6169-e271dd0edb16)。
无法创建约束。
解决方案:根据重复的键值,查询到重复的记录,然后删除重复记录,(操作前请备份好您用友T+财务软件中的数据,可参考教程:https://new.aiufida.com/jcufida/1389.html),示例语句如下:
delete from EAP_VoucherDraft where ID='21fdb25a-952b-f9a0-6169-e271dd0edb16' and Code='2014-10-15-0002'
if((select COUNT(ts) from EAP_VoucherDraft where ID='27f8bc75-a7e1-d6f9-e867-e27b87c5e7a4')>1)
begin
delete from EAP_VoucherDraft
where ID='27f8bc75-a7e1-d6f9-e867-e27b87c5e7a4'
and ts in (select top 1 ts from EAP_VoucherDraft where ID='27f8bc75-a7e1-d6f9-e867-e27b87c5e7a4')
end
if((select COUNT(ts) from EAP_VoucherDraft where ID='186EB51E-5B8A-CA28-8546-F9B9527A9ED7')>1)
begin
delete from EAP_VoucherDraft
where ID='186EB51E-5B8A-CA28-8546-F9B9527A9ED7'
and ts in (select top 1 ts from EAP_VoucherDraft where ID='186EB51E-5B8A-CA28-8546-F9B9527A9ED7')
End
执行这个:
delete from EAP_VoucherDraft
where ID in (select ID from EAP_VoucherDraft group by ID having count(ID) > 1)
相关文章
- 用友畅捷通T+怎么在一台电脑上安装多个版本的安装方法图文教程
- 用友畅捷通T+个别计价存货跌价损失计提的图文操作教程
- 用友畅捷通T+ T-UFO如何设置审核公式的图文操作教程
- 用友畅捷通T+T-UFO报表保存时提示:“保存失败,undefined”怎么办?
- 用友畅捷通T+11.5手机端连接提示:“地址不可用”
- 用友畅捷通T+11.51销货单如何变通使用会员储值功能的图文操作教程
- 用友畅捷通T+个别计价法二次出库不能选择对应的采购入库单怎么办?
- 用友畅捷通T+11.5如何进行跑店管理的图文操作教程
- 用友畅捷通T+T-UFO报表保存时提示:“保存失败,undefined”怎么办?
- 用友畅捷通T+自营店收银对账方式分为收银员对账和POS对账,两者有什么区别