|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
860[Main]升级前,关闭了连接
860[Main]升级前,打开了连接
860[Main]升级
关闭了系统数据库连接
重新打开了系统数据库连接
开始读取升级列表
结束读取升级列表
开始事务
2013-03-24 18:11:30
数据库名: UFDATA_502_2012
质量管理数据结构, dpstr860_qm
错误信息:
-2147217900
列 'dbo.Person.cPersonCode' 与外键 'FK_QMCHECKVOUCHER_Person' 中引用列 'QMCHECKVOUCHER.CYIELDERCODE' 的长度不同。
执行如下语句时出错:
--修改检验单表头
IF EXISTS (SELECT * FROM DBO.SYSOBJECTS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND OBJECTPROPERTY(ID, N'ISUSERTABLE') = 1)
BEGIN
-- IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'ISOORDERID')
-- ALTER TABLE QMCHECKVOUCHER ADD ISOORDERID int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IORDERTYPE')
ALTER TABLE QMCHECKVOUCHER ADD IORDERTYPE int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'ISOORDERAUTOID')
ALTER TABLE QMCHECKVOUCHER ADD ISOORDERAUTOID int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IPROORDERID')
ALTER TABLE QMCHECKVOUCHER ADD IPROORDERID int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IPROORDERAUTOID')
ALTER TABLE QMCHECKVOUCHER ADD IPROORDERAUTOID int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CCUSCODE')
ALTER TABLE QMCHECKVOUCHER ADD CCUSCODE VARCHAR(20) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CCONTRACTCODE')
ALTER TABLE QMCHECKVOUCHER ADD CCONTRACTCODE VARCHAR(64) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CPOSITION')
ALTER TABLE QMCHECKVOUCHER ADD CPOSITION VARCHAR(20) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'FISCOST')
ALTER TABLE QMCHECKVOUCHER ADD FISCOST userdecimal NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IAC')
ALTER TABLE QMCHECKVOUCHER ADD IAC int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IRE')
ALTER TABLE QMCHECKVOUCHER ADD IRE int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CINSLEVEL')
ALTER TABLE QMCHECKVOUCHER ADD CINSLEVEL VARCHAR(20) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'BEXIGENCY')
ALTER TABLE QMCHECKVOUCHER ADD BEXIGENCY bit NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CREASONCODE')
ALTER TABLE QMCHECKVOUCHER ADD CREASONCODE VARCHAR(10) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CYIELDERCODE')
ALTER TABLE QMCHECKVOUCHER ADD CYIELDERCODE VARCHAR(8) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'DYIELDDATE')
ALTER TABLE QMCHECKVOUCHER ADD DYIELDDATE datetime NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CMEMO')
ALTER TABLE QMCHECKVOUCHER ADD CMEMO VARCHAR(100) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CPROCESSAUTOID')
ALTER TABLE QMCHECKVOUCHER ADD CPROCESSAUTOID CHAR(4) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IWORKCENTER')
ALTER TABLE QMCHECKVOUCHER ADD IWORKCENTER int NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CCONTRACTSTRCODE')
ALTER TABLE QMCHECKVOUCHER ADD CCONTRACTSTRCODE VARCHAR(64) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CBYPRODUCT')
ALTER TABLE QMCHECKVOUCHER ADD CBYPRODUCT VARCHAR(20) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CCHECKTYPECODE')
ALTER TABLE QMCHECKVOUCHER ADD CCHECKTYPECODE VARCHAR(10) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'FAQL')
ALTER TABLE QMCHECKVOUCHER ADD FAQL VARCHAR(20) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CCOSTTYPE')
ALTER TABLE QMCHECKVOUCHER ADD CCOSTTYPE VARCHAR(10) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'FCOST')
ALTER TABLE QMCHECKVOUCHER ADD FCOST userdecimal NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CMASSUNIT')
ALTER TABLE QMCHECKVOUCHER ADD CMASSUNIT VARCHAR(2) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IMASSDATE')
ALTER TABLE QMCHECKVOUCHER ADD IMASSDATE smallint NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CSOORDERCODE')
ALTER TABLE QMCHECKVOUCHER ADD CSOORDERCODE VARCHAR(30) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'CPROORDERCODE')
ALTER TABLE QMCHECKVOUCHER ADD CPROORDERCODE VARCHAR(30) NULL
IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMCHECKVOUCHER]') AND NAME = 'IVERIFYSTATE')
ALTER TABLE QMCHECKVOUCHER ADD IVERIFYSTATE int NULL
IF NOT EXISTS (SELECT * FROM sysobjects WHERE ID = OBJECT_ID(N'[DBO].[FK_QMCHECKVOUCHER_Person]') AND OBJECTPROPERTY(ID, N'IsForeignKey') = 1)
BEGIN
ALTER TABLE [dbo].[QMCHECKVOUCHER] ALTER COLUMN CYIELDERCODE VARCHAR(20) NULL
ALTER TABLE [dbo].[QMCHECKVOUCHER] ADD
CONSTRAINT [FK_QMCHECKVOUCHER_Person] FOREIGN KEY
(
[CYIELDERCODE]
) REFERENCES [dbo].[Person] (
[cPersonCode]
)
END
IF NOT EXISTS (SELECT * FROM sysobjects WHERE ID = OBJECT_ID(N'[DBO].[FK_QMCHECKVOUCHER_SFC_WorkCenter]') AND OBJECTPROPERTY(ID, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[QMCHECKVOUCHER] ADD
CONSTRAINT [FK_QMCHECKVOUCHER_SFC_WorkCenter] FOREIGN KEY
(
[IWORKCENTER]
) REFERENCES [dbo].[SFC_WorkCenter] (
[WcId]
)
IF NOT EXISTS (SELECT * FROM sysobjects WHERE ID = OBJECT_ID(N'[DBO].[FK_QMCHECKVOUCHER_REASON]') AND OBJECTPROPERTY(ID, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[QMCHECKVOUCHER] ADD
CONSTRAINT [FK_QMCHECKVOUCHER_REASON] FOREIGN KEY
(
[CREASONCODE]
) REFERENCES [dbo].[REASON] (
[CREASONCODE]
)
END
效率测试报告:开始升级UFDATA_502_2012数据库
Update_DelRepeat.sql,2013-3-24 18:10:56 -- 2013-3-24 18:10:58,0小时0分钟2秒。
DSTR860_Public.SQL,2013-3-24 18:10:58 -- 2013-3-24 18:11:06,0小时0分钟8秒。
DSTR_MRP_Udt.SQL,2013-3-24 18:11:06 -- 2013-3-24 18:11:09,0小时0分钟3秒。
DSTR_SF.SQL,2013-3-24 18:11:09 -- 2013-3-24 18:11:10,0小时0分钟1秒。
DSTR_MP.SQL,2013-3-24 18:11:10 -- 2013-3-24 18:11:10,0小时0分钟0秒。
DSTR_MO.SQL,2013-3-24 18:11:10 -- 2013-3-24 18:11:11,0小时0分钟1秒。
DSTR_EC.SQL,2013-3-24 18:11:11 -- 2013-3-24 18:11:11,0小时0分钟0秒。
DSTR_CP.SQL,2013-3-24 18:11:11 -- 2013-3-24 18:11:11,0小时0分钟0秒。
DSTR_BO.SQL,2013-3-24 18:11:11 -- 2013-3-24 18:11:11,0小时0分钟0秒。
DSTR_BAS.SQL,2013-3-24 18:11:11 -- 2013-3-24 18:11:11,0小时0分钟0秒。
DSTR860_IA.SQL,2013-3-24 18:11:11 -- 2013-3-24 18:11:12,0小时0分钟1秒。
DSTR860_SA.SQL,2013-3-24 18:11:12 -- 2013-3-24 18:11:22,0小时0分钟10秒。
DSTR860_PU.SQL,2013-3-24 18:11:22 -- 2013-3-24 18:11:22,0小时0分钟0秒。
DSTR860_CM.SQL,2013-3-24 18:11:22 -- 2013-3-24 18:11:23,0小时0分钟1秒。
DSTR860_ST.SQL,2013-3-24 18:11:23 -- 2013-3-24 18:11:24,0小时0分钟1秒。
DATA860_ST.SQL,2013-3-24 18:11:24 -- 2013-3-24 18:11:24,0小时0分钟0秒。
dstr860_gs.SQL,2013-3-24 18:11:24 -- 2013-3-24 18:11:27,0小时0分钟3秒。
DSTR_PM.SQL,2013-3-24 18:11:27 -- 2013-3-24 18:11:28,0小时0分钟1秒。
DSTR_GF.SQL,2013-3-24 18:11:28 -- 2013-3-24 18:11:28,0小时0分钟0秒。
升级起始时间:2013-3-24 18:10:56,结束时间:2013-3-24 18:12:35,0小时1分钟39秒。
|
|