升级错误提示:这个打开错误的脚本
数据库名: UFDATA_004_2013
F:\U8SOFT\Admin\SQLFILE8710\Main\Ufdata\Structure\Data_PRV_CM_mix_NL.sql
错误信息:
-2147217865
对象名 ‘fitemss97’ 无效。
执行如下语句时出错:
/****** Object: View dbo.vwCM_Pay Script Date: 2003-07-31 15:03:54 ******/
ALTER VIEW dbo.vwCM_Pay
AS
SELECT ID, GUID,lngRowID, dtPayDate,dblPayRatio, dblPayCurrency,strSettleStyleID, strPayFactor,strExp, dblTotalCurrency,
dblExecCurrency, dblTotalQuantity,dblExecQuqantity, CONVERT(Money, tsTime) AS tsTime, strContractID,
CM_Contract_Pay.cItemCode,cItemName,iItemPercent,CM_Contract_Pay.cStageGroupCode,
CM_Contract_Pay.cStageCode,cStageName,dtStageExpectedEndDate
FROM dbo.CM_Contract_Pay
left join fitemss97 on CM_Contract_Pay.cItemCode=fitemss97.cItemCode
left join CM_Stage on CM_Contract_Pay.cStageCode=CM_Stage.cStageCode
********************以上错误经过分析是对应的数据库年度缺少fitemss97,fitemss97 class,fitemss97 sub三个表
从其他可以升级的年度,没有升级的数据库复制三个表即可.
或者执行下面脚本及可以.
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON
GO
SET NUMERIC_ROUNDABORT OFF
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
GO
PRINT N'Creating [dbo].[fitemss97] table'
GO
CREATE TABLE [dbo].[fitemss97] (
[I_id] [int] NOT NULL IDENTITY (1, 1),
[citemcode] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL,
[citemname] [varchar] (60) COLLATE Chinese_PRC_CI_AS NULL,
[bclose] [bit] NULL,
[citemccode] [varchar] (22) COLLATE Chinese_PRC_CI_AS NOT NULL,
[iotherused] [int] NULL,
[dEndDate] [datetime] NULL
)
GO
IF @@TRANCOUNT = 0 BEGIN TRANSACTION
GO
IF (@@ERROR <> 0) AND (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT > 0
COMMIT TRANSACTION
GO
ALTER TABLE [dbo].[fitemss97] ADD CONSTRAINT [PK_fitemss97] PRIMARY KEY CLUSTERED ([I_id])
GO
IF (@@ERROR <> 0) AND (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT > 0
COMMIT TRANSACTION
GO
IF @@TRANCOUNT = 0 BEGIN TRANSACTION
GO
PRINT N'Creating [dbo].[fitemss97class] table'
GO
CREATE TABLE [dbo].[fitemss97class] (
[i_id] [int] NOT NULL IDENTITY (1, 1),
[cItemCcode] [varchar] (22) COLLATE Chinese_PRC_CI_AS NOT NULL,
[cItemCname] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL,
[iItemCgrade] [tinyint] NOT NULL,
[bItemCend] [bit] NOT NULL
)
GO
IF @@TRANCOUNT = 0 BEGIN TRANSACTION
GO
IF (@@ERROR <> 0) AND (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT > 0
COMMIT TRANSACTION
GO
ALTER TABLE [dbo].[fitemss97class] ADD CONSTRAINT [PK_fitemss97class] PRIMARY KEY CLUSTERED ([i_id])
GO
IF (@@ERROR <> 0) AND (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT > 0
COMMIT TRANSACTION
GO
IF @@TRANCOUNT = 0 BEGIN TRANSACTION
GO
PRINT N'Creating [dbo].[fitemss97sub] table'
GO
CREATE TABLE [dbo].[fitemss97sub] (
[I_id] [int] NOT NULL IDENTITY (1, 1),
[citemcode] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL,
[citemname] [varchar] (60) COLLATE Chinese_PRC_CI_AS NULL,
[iclose] [int] NULL,
[dEndDate] [datetime] NULL
)
GO
IF @@TRANCOUNT = 0 BEGIN TRANSACTION
GO
IF (@@ERROR <> 0) AND (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT > 0
COMMIT TRANSACTION
GO
ALTER TABLE [dbo].[fitemss97sub] ADD CONSTRAINT [PK_fitemss97sub] PRIMARY KEY CLUSTERED ([I_id])
GO
CREATE UNIQUE NONCLUSTERED INDEX [PrimaryKey] ON [dbo].[fitemss97sub] ([citemcode])
GO
IF (@@ERROR <> 0) AND (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT > 0
COMMIT TRANSACTION
GO
PRINT 'Script deployment completed'
GO