一、问题:
cjt 15.0版本升级到18.0提示SQL 脚本: 18.000.000.0048 DATA_DSTR_EAP_Mix_NL-11001 出错:已在列上绑定了 DEFAULT
023-08-10 19:46:39 开始升级....
2023-08-10 19:46:39 正在校验系统信息,请稍候...
2023-08-10 19:46:39 [(000001)****]:开始升级
2023-08-10 19:46:39 [(000001)****]:正在核对版本,请稍候...
2023-08-10 19:46:39 [(000001)****]:加载升级信息,请稍候...
2023-08-10 19:46:39 一次升级多个账套时,模拟登录!
2023-08-10 19:47:56 [(000001)****]:开始升级,请稍候...
2023-08-10 19:47:56 [(000001)****]:开始执行脚本升级,请稍候...
2023-08-10 19:48:01 UFTData063468_000001升级出错,错误信息:UFTData063468_000001升级脚本出错,错误信息:SQL 脚本: 18.000.000.0048 DATA_DSTR_EAP_Mix_NL-11001 出错:已在列上绑定了 DEFAULT。
无法创建约束或索引。请参阅前面的错误。 在 Ufida.T.SM.Upgrade.Service.UpgradeHelper.ExecuteScript(TongVersion version, Queue`1 upgardeItems, VersionTypeEnum product, String currentDBName, Boolean isSaas)
在 Ufida.T.SM.Upgrade.Service.UpgradeHelper.UpgradeStruct(TongVersion version, VersionTypeEnum product, String currentDBName)
在 Ufida.T.SM.Upgrade.Service.UpgradeService.VersionsUpgrade(UpgradeContext context)
在 Ufida.T.SM.Upgrade.Service.UpgradeService.ExecUpgradeScript(UpgradeContext context)
在 Ufida.T.SM.Upgrade.Service.UpgradeService.Upgrade(UpgradeContext context)![具体出错信息请参见:D:\Chanjet\TPlusPop\Appserver\server\..\logs\UFTData063468_000001_Upgrade.log![具体出错信息请参见:D:\Chanjet\TPlusPop\Appserver\server\..\logs\UFTData063468_000001_Upgrade.log
2023-08-10 19:48:01 在 Ufida.T.EAP.Aop.Server.ServerDynamicProxyImpl.NormalInvoke(MethodBase method, Object[] args)
在 Ufida.T.EAP.Aop.Server.ServerDynamicProxyImpl.Invoke(IMessage message)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Ufida.T.SM.Upgrade.Interface.IUpgrade.Upgrade(UpgradeContext context)
在 Ufida.T.Tool.SM.Account.FrmMain.UpgradeSelectedAccount()
二、解决办法
-
在安装路径Chanjet\TPlusPro\Appserver\Upgrade下面找到提示的文件夹16.000.000.0226,找到对应的DATA_DSTR_EAP_Mix_NL-11001文件,找到后右键以记事本方式打开该文件,全部复制到数据库中对相应的账套执行;
-
执行出现报错,双击红色字体,自动定位至错误的表名,复制表名与列名
-
案例中表名为:EAP_DetailAtt 列名为:FileContent,将出错的表名和列明替换至下面的语句中:
declare @tablename varchar(100),@columnname
varchar(100),@tab varchar(100)
set @tablename = '表名'
set @columnname = '列名'
declare @defname varchar(100)
declare @cmd varchar(100)
select @defname = name from sysobjects so
join sysconstraints sc on so.id = sc.constid where
object_name(so.parent_obj) =@tablename and
so.xtype ='d' and sc.colid = (select colid from syscolumns
where id = object_id(@tablename) and name
=@columnname)
select @cmd = 'alter table ' + @tablename
+' drop constraint ' + @defname
if @cmd is null
print 'no default constraint to drop'
exec(@cmd)
Go
标签:脚本,10,Upgrade,000001,19,08,列上,出错,2023
From: https://www.cnblogs.com/wherehappens/p/17622722.html