Using the following query I'm doing transactions with two tables
BEGIN TRANSACTION UPDATE SalaryTrans SET carried_forward_amount = @carriedForwardAmount, net_wage=@netWage, processed_date = @processedDate WHERE employee_id=@employeeID AND reference = @reference DELETE FROM CarriedForward WHERE employee_id = @employeeID INSERT INTO CarriedForward (employee_id, carried_forward_amount) VALUES(@employeeID, @carriedForwardAmount) COMMIT;
First SalaryTrans table is updated. Then all matching records in CarriedForward table are deleted and new details are entered.
I just want to know whether this approach is acceptable or there are better ways to write this.