• http://msdn.microsoft.com/en-us/library/ms188929.aspx

    BEGIN TRANSACTION

    Arguments

    transaction_name

    Is the name assigned to the transaction. transaction_name must conform to the rules for identifiers, but identifiers longer than 32 characters are not allowed. Use transaction names only on the outermost pair of nested BEGIN...COMMIT or BEGIN...ROLLBACK statements.

    http://msdn.microsoft.com/en-us/library/ms190295.aspx

    COMMIT TRANSACTION: Marks the end of a successful implicit or explicit transaction. If @@TRANCOUNT is 1, COMMIT TRANSACTION makes all data modifications performed since the start of the transaction a permanent part of the database, frees the resources held by the transaction, and decrements @@TRANCOUNT to 0. If @@TRANCOUNT is greater than 1, COMMIT TRANSACTION decrements @@TRANCOUNT only by 1 and the transaction stays active.

    Arguments

    transaction_name

    Is ignored by the SQL Server Database Engine.

    http://msdn.microsoft.com/en-us/library/ms181299.aspx

    ROLLBACK TRANSACTION

    Rolls back an explicit or implicit transaction to the beginning of the transaction, or to a savepoint inside the transaction.

    Arguments

    transaction_name

    Is the name assigned to the transaction on BEGIN TRANSACTION. transaction_name must conform to the rules for identifiers, but only the first 32 characters of the transaction name are used. When nesting transactions, transaction_name must be the name from the outermost BEGIN TRANSACTION statement.

    So the commit just decrements the transaction count by 1, leaving it at a value of 1. When the rollback fires,the entire transaction, back to the first begin tran is rolled back.

    Transaction names are more for descriptive or documentation than anything else.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass