|
楼主 |
发表于 2010-10-19 16:53:17
|
显示全部楼层
不好意思 按太快了,接上面的 我从演示帐套里只找到了BG_CtrlRules ,另外两个视图U872和U890的演示帐套都没有,求高手赐教如何解决,在线等 谢谢!
错误信息如下所示:错误信息:
-2147217900
对象名 'UFDATA_002_2009.dbo.BG_CtrlRulesMaster' 无效。
执行如下语句时出错:
--BG_CtrlRule视图在871中已经存在,872不删除
--不存在公式表,则需要升级(备份原有表数据)。否则清理这些临时表
if not exists(select * from dbo.sysobjects where name = 'BG_BudgetFormula' and xtype = 'U')
begin
if exists(select top 1 * from BG_Form)
begin
--备份数据
--精度
select * into BG_UnitDigitCount_Tmp from BG_UnitDigitCount
--版版
select * into BG_Version_Tmp from BG_Version
--预算假设
select * into BG_Hypothesis_Tmp from BG_Hypothesis
--项目类型
select * into BG_ItemType_Tmp from BG_ItemType
--预算项目
select * into BG_Item_Tmp from BG_Item
--预算类型
select * into BG_Genre_Tmp from BG_Genre
--预算表
select * into BG_Form_Tmp from BG_Form
--预算表构成
select * into BG_Forms_Tmp from BG_Forms
--录入点表
select * into BG_ItemInputForms_Tmp from BG_ItemInputForms
--分析表
select * into BG_AnalyseForms_Tmp from BG_AnalyseForms
--查询表
select * into BG_QueryForms_Tmp from BG_QueryForms
--预算数据
select * into BG_FormData_Tmp from BG_FormData
select * into BG_FormBgDatas_Tmp from BG_FormBgDatas
--历史数据
select * into BG_HistoryData_Tmp from BG_HistoryData
--实际数
select * into BG_FormFactDatas_Tmp from BG_FormFactDatas
--控制规则
select * into BG_CtrlObject_Tmp from BG_CtrlObject
select * into BG_CtrlRule_Tmp from BG_CtrlRule
select * into BG_CtrlRuleMapRelation_Tmp from BG_CtrlRuleMapRelation
--控制实际数
select * into BG_CtrlFactDatas_Tmp from BG_CtrlFactDatas
--超预算审批金额权限
select * into BG_MoneyAuth_Tmp from BG_MoneyAuth
--集团日志
select * into BG_MutualLog_Tmp from BG_MutualLog
--调整单
--select * into BG_RegulateBill_Tmp from BG_RegulateBill
--select * into BG_RegulateBills_Tmp from BG_RegulateBills
--select * into BG_RegulateEffect_Tmp from BG_RegulateEffect
--抽取作业
select * into BG_FetchJobs_Tmp from BG_FetchJobs
--抽取日志
select * into BG_FetchLog_Tmp from BG_FetchLog
--升级预算机构
select * into BG_Organ_Tmp from BG_Organ
--升级执行数公式
select * into BG_Formula_Tmp from BG_Formula
end
end
else
begin
if exists(select top 1 * from BG_Form)
begin
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_AnalyseForms_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_AnalyseForms_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_CtrlFactDatas_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_CtrlFactDatas_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_CtrlObject_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_CtrlObject_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_CtrlRuleMapRelation_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_CtrlRuleMapRelation_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_FetchJobs_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_FetchJobs_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_FetchLog_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_FetchLog_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_FormBgDatas_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_FormBgDatas_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_FormData_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_FormData_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_FormFactDatas_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_FormFactDatas_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_Form_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_Form_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_Forms_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_Forms_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_Genre_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_Genre_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_HistoryData_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_HistoryData_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_Hypothesis_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_Hypothesis_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_ItemInputForms_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_ItemInputForms_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_ItemType_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_ItemType_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_MoneyAuth_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_MoneyAuth_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_MutualLog_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_MutualLog_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_Organ_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_Organ_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_QueryForms_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_QueryForms_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_UnitDigitCount_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_UnitDigitCount_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_Version_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_Version_Tmp]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BG_Formula_Tmp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BG_Formula_Tmp]
end
end |
|