|
发表于 2010-3-30 16:44:27
|
显示全部楼层
你看看能不能看懂。
--1、无法将 NULL 值插入列 'VT_ID',表 'UFDATA_555_2007.dbo.VoucherItems';该列不允许空值。 INSERT 失败。
------------------------------------
insert into VoucherTemplates
(VT_ID,VT_Name,VT_CardNumber,VT_TemplateMode,VT_Width,VT_Height,VT_BodyTop,VT_BodyLeft,VT_BodyWidth,VT_BodyHeight,VT_SelfDef1,VT_SelfDef2,VT_SelfDef3,VT_Memo,VT_Lock,VT_TitleName,VT_TitleTop,VT_TitleLeft,VT_TitleFontState,VT_PageHeader,VT_BodyFixedCols,VT_BodyMaxRows,VT_GridStyle,VT_WorkAreaColor,VT_FiexdColor,VT_ControlStyle,VT_GridStyleHead,VT_GridStyleBody,VT_GridstyleTotal,VT_GridPrnRows,VT_GridPrnRowHeight,VT_Header,VT_Foot,VT_footHeaderFont,VT_PrintTemplID,VT_AutoCalc,VT_PageSubTotal,VT_PageTotal,VT_PrintGrid,nAutoCalcWidth,nPrintSeril,nPrintGridLine,varPrintSetting)
select
VT_ID,'' as VT_Name,VT_CardNumber,VT_TemplateMode,VT_Width,VT_Height,VT_BodyTop,VT_BodyLeft,VT_BodyWidth,VT_BodyHeight,VT_SelfDef1,VT_SelfDef2,VT_SelfDef3,VT_Memo,VT_Lock,VT_TitleName,VT_TitleTop,VT_TitleLeft,VT_TitleFontState,VT_PageHeader,VT_BodyFixedCols,VT_BodyMaxRows,VT_GridStyle,VT_WorkAreaColor,VT_FiexdColor,VT_ControlStyle,VT_GridStyleHead,VT_GridStyleBody,VT_GridstyleTotal,VT_GridPrnRows,VT_GridPrnRowHeight,VT_Header,VT_Foot,VT_footHeaderFont,VT_PrintTemplID,VT_AutoCalc,VT_PageSubTotal,VT_PageTotal,VT_PrintGrid,nAutoCalcWidth,nPrintSeril,nPrintGridLine,varPrintSetting from ufdata_001_2010..VoucherTemplates
Where VT_ID not in (select VT_ID from VoucherTemplates)
--------------------------------------
--2、将 varchar 值 'IA01' 转换为数据类型为 int 的列时发生语法错误。
select * from AccInformation order by cid desc
可以看到 cid 有非数值
------------------------------
把AccInformation表中的cvalue ,cname,ccaption长度设成2倍长;
delete from AccInformation where csysid in ('OM','SA','IA')
insert into AccInformation (csysid,cid,cname,ccaption,ctype,cvalue,cdefault,bvisible,benable)
select csysid,cid,cname,ccaption,ctype,cvalue,cdefault,bvisible,benable from ufdata_001_2010..AccInformation where csysid in ('OM','SA','IA')
--------------------------------
--3、违反了 PRIMARY KEY 约束 'PK_VT_ID'。不能在对象 'VoucherTemplates' 中插入重复键。
------------
delete from VoucherTemplates where VT_ID in ('20008','20009','20010','20012')
------------
--4、违反了 PRIMARY KEY 约束 'PK_VoucherPrefabricate'。不能在对象 'VoucherPrefabricate' 中插入重复键。
-----------------------
delete from VoucherPrefabricate where CardNumber in ('QM01','QM02','QM03','QM04','QM05','QM06','QM07','QM08','QM09','QM10','QM11','QM12','QM13','QM14','QM15','QM16','QM17','QM18','QM19','QM20') and cContent = '手工输入'
-----------------------
--5、错误信息:
数据库名: UFDATA_555_2007
D:\U8SOFT\Admin\SQLFILE8610\Main\Ufdata\data\zh-CN\Data_Upda_PU_Query_CN.sql
错误信息:
-2147467259
子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
执行如下语句时出错:
--
DECLARE @ID INT
DECLARE @TempIDS INT
SET @ID=(SELECT ID FROM rpt_glbdef_base WHERE Name='采购入库单列表过滤' and localeid='zh-CN')
SET @TempIDS= (SELECT TOP 1 MAX(Location)+1 FROM Rpt_fltDef_base WHERE ID=@ID and localeid='zh- CN')
IF NOT EXISTS(SELECT ID FROM Rpt_fltDef_base WHERE localeid='zh- CN' AND Name='copyrdlist.cWhCode' AND ID=@ID)
Insert into Rpt_fltDef_base ([Localeid], [Location],[ID],[Name],[Note], [Expression],[ModeEx],[IsSingle],[Flag],[Caption],[iLeft],[iTop], [iWidth],[iHeight],[iCaptionLeft],[iCaptionWidth],[iPage], [iRefSelect] ) Values ( 'zh-CN',@TempIDS,@ID,'copyrdlist.cWhCode','仓库编码','5,仓库档案',2,2,0, Null,1,0,0,0,0,0,0,1 )
----------------
因找不到具体的原因,在不影响升级程序正常的情况下,可以在admin.rar文件中找到:Data_Upda_PU_Query_CN.sql文件,并找到如下语句:
SET @ID=(SELECT ID FROM rpt_glbdef_base WHERE Name='采购入库单列表过滤' and localeid='zh-CN')
改成:SET @ID=(SELECT top 1 ID FROM rpt_glbdef_base WHERE Name='采购入库单列表过滤' and localeid='zh-CN')
即增加了一个top 1 |
|