>Actually that is what I have done. Before I begin my transaction I do all the updating, then begin the transaction and if any of the updates fail I issue a rollback and then do tablerevert on all the tables. But is this an ok procedure to follow in the future. Should I have instead done my updating say on one table within the transaction, issue a tableupdate and if that failed issue a rollback before attempting to update the second table. Or is it ok to do all the updating outside the transaction and then issue rollback and table revert on all the tables.
You
must do the tableupdates
inside the transaction. So, the sequence of things will be:
BEGIN TRANSACTION
result = TABLEUPDATE(Table1)
IF Result = .t.
Result = TABLEUPDATE(Table2)
ENDIF
IF Result = .t.
Result = TABLEUPDATE(Table3)
ENDIF
* Update other tables the same way
IF Result = .T.
ENDTRANSACTION
ELSE
ROLLBACK
ENDIF
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer