Transactions Locks «Prev 

Creating transactions

Syntax for SQL-Server Transaction Statements

SQL Server 2014, Marks the starting point of an explicit, local transaction. BEGIN TRANSACTION increments @@TRANCOUNT by 1.

BEGIN { TRAN | TRANSACTION } 
    [ { transaction_name | @tran_name_variable }
      [ WITH MARK [ 'description' ] ]
    ]
[ ; ]

transaction_name is the name of your transaction. This is only used in the case of nested transactions so that they can be distinguished from each other, but is only used for the outer-most transaction.

@transaction_variable is the name of your transaction as stored in a variable

transaction_name is the name of your transaction. This is only used in the case of nested transactions so that they can be distinguished from each other, but is only used for the outer-most transaction.

@transaction_variable is the name of your transaction as stored in a variable

transaction_name is the name of your transaction. This is only used in the case of nested transactions so that they can be distinguished from each other, but is only used for the outer-most transaction.

@transaction_variable is the name of your transaction as stored in a variable.

@savepoint_name is the name of your savepoint, as specified in a SAVE TRANSACTION Transact-SQL statement. This allows for you to rollback part of the transaction, without having to rollback the entire transaction.

@savepoint_variable is the name of your savepoint, as specified in the SAVE TRANSACTION Transact-SQL statement, as stored in a variable