begin transaction

Description

Marks the starting point of a user-defined transaction.

Syntax

begin tran[saction] [transaction_name]

Parameters

transaction_name

is the name assigned to this transaction. Transaction names must conform to the rules for identifiers. Use transaction names only on the outermost pair of nested begin transaction/commit or begin transaction/rollback statements.

Examples

Example 1

Explicitly begins a transaction for the insert statement:

begin transaction
    insert into publishers (pub_id) values ("9999")
commit transaction

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

No permission is required to use begin transaction.

See also

Commands commit, rollback, save transaction