December 2013
Intermediate to advanced
1872 pages
153h 31m
English
AutoCommit is the default transaction mode for SQL Server. Each individual T-SQL command automatically commits or rolls back its work at the end of its execution. Each SQL statement is considered to be its own transaction, with begin and end control points implied. Following is an example:
[implied begin transaction]UPDATE account SET balance = balance + 1000 WHERE account_no = "123456789"[implied commit or rollback transaction]
If an error is present in the execution of the statement, the action is undone (that is, rolled back); if no errors occur, the action is completed, and the changes are saved.
Now let’s consider the banking transaction mentioned at the beginning of this chapter ...