DEV Community

Discussion on: Design a Table to Keep Historical Changes in Database

 
anandpowar profile image
Anand Powar

You can run two distinctive inserts within the same transaction scope.


Begin transaction 
  Insert into original-table
  Get inserted auto-id (optional)
  Insert into history-table
Commit transaction

Enter fullscreen mode Exit fullscreen mode