W
wen_one
Unregistered / Unconfirmed
GUEST, unregistred user!
本人用ado連接sql2000的數據庫,其中主表為main(關鍵字:id,identity)主表detail
(關鍵字為:id,identity,並有一字段join_id與main表的id連接)。現本人寫main表的del
觸發器代碼如下delete detail from detial,deleted where detail.join_id=deleted.id
在sql執行delete main where id=123沒問題能刪除子表相連記錄
但在delphi下,
adoquery_main.delete;
adoconnection.begintrans
try
adoquery_main.updatebatch(arll);//這時出錯
adoconnection.committrans;
except
adoconnection.rollbackcommit;
end;
出錯信息為:key column information is insuffcient or incorrect,too many rows were
affected by update.
delphi為delphi6,ado為2.6的版本.
(關鍵字為:id,identity,並有一字段join_id與main表的id連接)。現本人寫main表的del
觸發器代碼如下delete detail from detial,deleted where detail.join_id=deleted.id
在sql執行delete main where id=123沒問題能刪除子表相連記錄
但在delphi下,
adoquery_main.delete;
adoconnection.begintrans
try
adoquery_main.updatebatch(arll);//這時出錯
adoconnection.committrans;
except
adoconnection.rollbackcommit;
end;
出錯信息為:key column information is insuffcient or incorrect,too many rows were
affected by update.
delphi為delphi6,ado為2.6的版本.