In very basic terms they are both used in conjunction with
BEGIN TRANS
after you complete a transacion you are meant to perform a test and if all is ok then you COMMIT the transaction. The transaction is now complete and can't be undone easily.
If however something went wrong then you ROLLBACK the transaction and everything will be returned to the state it was in before you BEGIN TRANSACTION
does that make sense?
Commit : if specifies the commit all the rows updated till that point are permently save in the database, only if the program successfully execute their will be auto commit.
Rollback : if specifies the rollback, whatever rows updated by the program are reverted or undone. when the program unsuccessfully execute the system will be auto rollback.
Comment