
Explanation/Reference:
Box 1: SET XACT_ABORT ON;
XACT_ABORT specifies whether SQL Server automatically rolls back the current transaction when a Transact-SQL statement raises a run-time error.
When SET XACT_ABORT is ON, if a Transact-SQL statement raises arun-time error, the entire transaction is terminated and rolled back.
Box 2: IF (XACT_STATE()) =-1
If XACT_STATE has the value of -1, then the current request has an active user transaction, but an error has occurred that has caused the transaction to beclassified as an uncommittable transaction. The request cannot commit the transaction or roll back to a savepoint; it can only request a full rollback of the transaction.
Box 3: IF (XACT_STATE()) =1
If XACT_STATE has the value of 1, then the current request has an active user transaction. The request can perform any actions, including writing data and committing the transaction.
References:
https://msdn.microsoft.com/en-us/library/ms188792.aspx
https://msdn.microsoft.com/en-us/library/ms189797.aspx