-- the source of the problem: use the datetime field value to locate the record
-- the particular SQL statement generated by delhpi ADOExpress
exec sp_executesql N'delete from test_table where
sequence_key_id = @P1 and
staff_id = @P2 and
trn_date = @P3 and
type = @P4 and
start_time = @P5 and
finish_time = @P6 and
completed = @P7 and
created_user = @P8 and
created_date = @P9 and
modified_user = @P10 and
modified_date = @P11
',N'@P1 varchar(50),@P2 varchar(50),@P3 datetime,@P4 varchar(50),@P5 datetime,@P6 datetime,@P7 int,@P8 varchar(50),@P9 datetime,@P10 varchar(50),@P11 datetime','1','2',
'2007-02-05 00:00:00:000','0','2007-02-05 18:42:26:000','2007-02-05 18:42:26:000',0,
'Local/David','2007-02-04 18:42:32:000','Local/David',
'2007-02-05 18:42:26:000'
-----------------
actually, it's expected to be:
delete from test_table where
sequence_key_id = @P1
solution:
-----------------
1) set the providerflag
sequence_key_id: [pfInKey, pfInUpdate, pfInWhere]
2) set the provider's UpdateMode to upWhereKeyOnly. Yeah!!!!!