|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
U811.0升级到13.0的时候有一个账套升级错误。报错为:-2147217865
对象名 'fa_SourceScale_update' 无效。
执行如下语句时出错:
declare @constraint varchar(100)
declare @sql varchar(8000)
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fa_SourceScale]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
begin
set @sql=' select * into fa_SourceScale_update from fa_SourceScale delete fa_SourceScale '
select @constraint=name from sysobjects where id in(
select cdefault from syscolumns where name='dblscale' and id in(select id from sysobjects where
name='fa_sourcescale'))
set @sql=@sql + ' alter table fa_SourceScale drop constraint '+ @constraint
set @sql=@sql + ' alter table fa_SourceScale drop column dblScale '
set @sql=@sql + ' alter table fa_SourceScale add dblScale numeric(15,14) NULL DEFAULT (1) '
exec(@sql)
set @sql= ' insert into fa_SourceScale(scardnum,loptid,ssourcenum,dblscale) select scardnum,loptid,ssourcenum,dblscale
from fa_SourceScale_update '
set @sql=@sql + ' drop table fa_SourceScale_update'
exec(@sql)
end
|
|