O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Distributed Transactions

As you learned on Chapter 13, "Maintaining Data Consistency: Transactions and Locks," you can consider a group of Transact-SQL statements as part of the same transaction. If the data affected by a transaction is spread across different servers, you need to create a distributed transaction.

To create a distributed transaction, you must start the Microsoft Distributed Transaction Coordinator service (MS-DTC), and the connection must use the SET_XACT_ABORT ON setting.

MS-DTC implements a two-phase commit mechanism to guarantee transaction consistency across different servers. This process can be described as follows:

  1. You connect to a SQL Server instance and start a distributed transaction, using the SET XACT_ABORT ON ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required