Defining Transactions

You can carry out transaction processing with Microsoft SQL Server in three ways:

  • AutoCommit—Every Transact-SQL statement is its own transaction and automatically commits when it finishes. This is the default mode in which SQL Server operates.

  • Explicit—This approach provides programmatic control of the transaction using the BEGIN TRAN and COMMIT/ROLLBACK TRAN/WORK commands.

  • Implicit—SQL Server is placed into a mode of operation in which issuing certain SQL commands automatically starts a transaction. The developer must finish the transaction by explicitly issuing the COMMIT/ROLLBACK TRAN/WORK commands.

Each of these methods is discussed in the following sections.

NOTE

The terms for explicit and implicit transactions can be ...

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.