|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
数据库名: 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
具体是升级到 8.60SP的时候出现的,请教了 |
|