找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
查看: 2000|回复: 1

[求助] tong10.1升级U8.72到U8.60时出错,急!帮忙

[复制链接]
发表于 2009-11-23 00:53:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
数据库名: UFDATA_008_2006
D:\U8SOFT\Admin\SQLFILE8600\Main\Ufdata\dpstr860_qm.sql

错误信息:
-2147217900
外键 'FK_QMINSPECTVOUCHER_SFC_WorkCenter' 引用了无效的表 'dbo.SFC_WorkCenter'。

执行如下语句时出错:
--修改报检单表头
IF EXISTS (SELECT * FROM DBO.SYSOBJECTS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND OBJECTPROPERTY(ID, N'ISUSERTABLE') = 1)
BEGIN
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CSOORDERCODE')
        ALTER TABLE QMINSPECTVOUCHER ADD CSOORDERCODE varchar(30) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'ISOORDERAUTOID')
        ALTER TABLE QMINSPECTVOUCHER ADD ISOORDERAUTOID int NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'IPROORDERID')
        ALTER TABLE QMINSPECTVOUCHER ADD IPROORDERID int NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CPROORDERCODE')
        ALTER TABLE QMINSPECTVOUCHER ADD CPROORDERCODE varchar(30) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'IPROORDERAUTOID')
        ALTER TABLE QMINSPECTVOUCHER ADD IPROORDERAUTOID int NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CCUSCODE')
        ALTER TABLE QMINSPECTVOUCHER ADD CCUSCODE varchar(20) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CCONTRACTCODE')
        ALTER TABLE QMINSPECTVOUCHER ADD CCONTRACTCODE varchar(64) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CCONTRACTSTRCODE')
        ALTER TABLE QMINSPECTVOUCHER ADD CCONTRACTSTRCODE varchar(64) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'IWORKCENTER')
        ALTER TABLE QMINSPECTVOUCHER ADD IWORKCENTER int NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CPROCESSAUTOID')
        ALTER TABLE QMINSPECTVOUCHER ADD CPROCESSAUTOID char(4) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'BEXIGENCY')
        ALTER TABLE QMINSPECTVOUCHER ADD BEXIGENCY bit NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CCHECKTYPECODE')
        ALTER TABLE QMINSPECTVOUCHER ADD CCHECKTYPECODE varchar(10) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'CINSPECTDEPCODE')
        ALTER TABLE QMINSPECTVOUCHER ADD CINSPECTDEPCODE varchar(12) NULL
   IF NOT EXISTS (SELECT * FROM DBO.SYSCOLUMNS WHERE ID = OBJECT_ID(N'[DBO].[QMINSPECTVOUCHER]') AND NAME = 'IORDERTYPE')
        ALTER TABLE QMINSPECTVOUCHER ADD IORDERTYPE int NULL
   IF NOT EXISTS (SELECT * FROM sysobjects WHERE ID = OBJECT_ID(N'[DBO].[FK_QMINSPECTVOUCHER_SFC_WorkCenter]') AND OBJECTPROPERTY(ID, N'IsForeignKey') = 1)
        ALTER TABLE [dbo].[QMINSPECTVOUCHER] ADD
    CONSTRAINT [FK_QMINSPECTVOUCHER_SFC_WorkCenter] FOREIGN KEY
    (
        [IWORKCENTER]
    ) REFERENCES [dbo].[SFC_WorkCenter] (
     [WcId]
    )
   IF NOT EXISTS (SELECT * FROM sysobjects WHERE ID = OBJECT_ID(N'[DBO].[FK_QMINSPECTVOUCHER_Department1]') AND OBJECTPROPERTY(ID, N'IsForeignKey') = 1)
        ALTER TABLE [dbo].[QMINSPECTVOUCHER] ADD  
           CONSTRAINT [FK_QMINSPECTVOUCHER_Department1] FOREIGN KEY
    (
     [CINSPECTDEPCODE]
           ) REFERENCES [dbo].[Department] (
     [cDepCode]
    )
END
发表于 2009-11-23 20:37:50 | 显示全部楼层
检查该表是否存在?
您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-11-25 00:36 , Processed in 0.038302 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表