What is the use of commit command in SQL?

1 answer

Answer

1008923

2026-03-02 21:10

+ Follow

If commands are executed within a transaction, the commitwill make the changes made by the commands permanent. The commands can also be undone using a rollback or by closing the session without an explicit commit.

For example;

begin transaction

go

update customer set Balance = Balance * 0.15

update product set OnHand = 0

delete vendor

go

commit transaction

If the process gets as far as the commit, then all of the commands will happen. If something goes wrong, such as the server rebooting, then any changes will be undone.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.