Beginning and committing transactions

The begin transaction and commit transaction commands can enclose any number of SQL statements and stored procedures. The syntax for both statements is:

begin {transaction | tran} [transaction_name]
commit {transaction | tran | work} [transaction_name]

where transaction_name is the name assigned to the transaction, which must conform to the rules for identifiers.

The keywords transaction, tran, and work (in commit transaction) are synonymous; you can use them interchangeably. However, transaction and tran are Transact-SQL extensions; only work is compliant with SQL-standards.

For example:

begin tran 
    statement 
    procedure 
    statement
commit tran

commit transaction does not affect Adaptive Server if the transaction is not currently active.