Marks the ending point of a user-defined transaction.
commit [tran | transaction | work] [transaction_name]
begin transaction royalty_change update titleauthor set royaltyper = 65 from titleauthor, titles where royaltyper = 75 and titleauthor.title_id = titles.title_id and title = "The Gourmet Microwave" update titleauthor set royaltyper = 35 from titleauthor, titles where royaltyper = 25 and titleauthor.title_id = titles.title_id and title = "The Gourmet Microwave" save transaction percentchanged update titles set price = price * 1.1 where title = "The Gourmet Microwave" select (price * total_sales) * royaltyper from titles, titleauthor where title = "The Gourmet Microwave" and titles.title_id = titleauthor.title_id rollback transaction percentchanged commit transaction
Define a transaction by enclosing SQL statements and system procedures with the phrases begin transaction and commit. If you set the chained transaction mode, the SAP ASE server implicitly invokes a begin transaction before the following statements: delete, insert, open, fetch, select, and update. You must still explicitly enclose the transaction with a commit.
To cancel all or part of an entire transaction, use the rollback command. The begin transaction command must appear within a transaction. You cannot roll back a transaction after the commit has been entered.
If no transaction is currently active, the commit or rollback statement has no effect on the SAP ASE server.
ANSI SQL – Compliance level: Entry-level compliant.
The commit transaction and commit tran forms of the statement are Transact-SQL extensions.
No permission is required to use commit.