紧急求救:谁知道出错的原因和解决办法?
有一个使用了近两年的数据库,大小接近3G,数据库是SQL SERVER2000,客户端程序用delphi5开发,在进行业务结算时要把临时表中要结算的记录保存到历史表中,使用下面的SQL 语句:
insert into ordercost
select inid,wardid,intimes,costdate,ordercode,dose,
ptimes,orderprice,lors,performid,payid,itemid,:pay as pay,type,docnum
from tmporderCost
where costdate between :day1 and :day2
and intimes=:intimes
and inid=:inid
and ensure=1
:pay是结算标识,:day1和:day2是时间范围,:intimes和:inid是查询条件
这语句的执行一直没有问题,知道今天早上出现如下错误提示:
Project finance.exe raised exception class EDBEngineError with message 'Key Violation'
[Miscrosoft][ODBC SQL Server Driver][SQL Server]表错误:数据库ID7,对象ID1186103266,索引ID
General SQL Server error.
4. 链的链接不匹配.(1:270824)->Next=(1:22923)。但(1:22923)->Prev=(1:270825)
Process stopped.Use Step or Run to continue.
我用查询分析器单独运行这条语句也出现上面的出错信息,估计不是应用程序的问题,好象是数据表的问题。